Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:26:45+00:00 2026-06-11T18:26:45+00:00

n1 = (EditText) findViewById(R.id.num1); int no1 = Integer.parseInt(n1.getText().toString()); n2 = (EditText) findViewById(R.id.num2); int no2

  • 0
    n1 = (EditText) findViewById(R.id.num1);
    int no1 = Integer.parseInt(n1.getText().toString());
    n2 = (EditText) findViewById(R.id.num2);
    int no2 = Integer.parseInt(n2.getText().toString());
    message = (EditText) findViewById(R.id.message);
    String msg = message.getText().toString();
    settings.execSQL("CREATE TABLE IF NOT EXISTS settingtb(mob1 LONG,mob2 LONG,time VARCHAR,message VARCHAR(1000));");
    settings.execSQL("INSERT INTO settingtb VALUES('" + no1 + "','" + no2
            + "'," + time + ",'" + msg + "');");

data is inserted into database if the mob1,mob2 values are less than 10 values if it exceed 9 values im getting numberformat exception

here is my logcat

09-24 18:16:23.594: E/AndroidRuntime(1656): FATAL EXCEPTION: main
09-24 18:16:23.594: E/AndroidRuntime(1656): java.lang.NumberFormatException: Invalid int: "7842334531"
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.Integer.invalidInt(Integer.java:138)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.Integer.parse(Integer.java:378)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.Integer.parseInt(Integer.java:366)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.Integer.parseInt(Integer.java:332)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at com.example.esha.settings.calltable(settings.java:87)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at com.example.esha.settings$1.onClick(settings.java:76)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.view.View.performClick(View.java:4084)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.view.View$PerformClick.run(View.java:16966)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.os.Handler.handleCallback(Handler.java:615)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.os.Handler.dispatchMessage(Handler.java:92)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.os.Looper.loop(Looper.java:137)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at android.app.ActivityThread.main(ActivityThread.java:4745)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.reflect.Method.invokeNative(Native Method)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at java.lang.reflect.Method.invoke(Method.java:511)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-24 18:16:23.594: E/AndroidRuntime(1656):     at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:26:46+00:00Added an answer on June 11, 2026 at 6:26 pm

    You need to change your this integer variable into long as below,

    long no2 = Long.parseLong(n2.getText().toString().trim());
    

    You are inserting values in wrong way, you are inserting String value in mob1 & mob2 fields, Convert it in to number as follows,

    settings.execSQL("INSERT INTO settingtb VALUES(" + no1 + "," + no2
                + "," + time + ",'" + msg + "');");
    

    You don’t need to add ' when you are inserting numeric value.

    Also when you are fetching the values, you are doing wrong, you are accessing everything in integer variable ??? change it according as follows,

    c.moveToFirst();  
         if(c!=null)
         {
          do{
            long c1 = c.getColumnIndex("mob1");
            long c2 = c.getColumnIndex("mob2");
            String c3 = c.getColumnIndex("time");
            String c4 = c.getColumnIndex("message");
    
            s1 = c.getString(c1);
            s2 = c.getString(c2);
            s3 = c.getString(c3);
            s4 = c.getString(c4);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EditText ed1 = (EditText)findViewById( R.id.editText1 ); int a = Integer.parseInt( ed1.getText().toString() ); Does the
et = (EditText) findViewById(R.id.editText1); iv = (ImageView) findViewById(R.id.imageView1); Case R.id.ibGo: String str = et.getText().toString();
EditText recEmail=(EditText)findViewbyId(R.id.email); EditText recPassword=(EditText)findViewbyId(R.id.password); String email=recEmail.getText().toString(); String password=recPassword.getText().toString(); The email and password contains the
Ok, I'm using the code: EditText editText = (EditText) findViewById(R.id.editText1); String value = editText.getText().toString();
the code is: editText2=(EditText) findViewById(R.id.editText2); editText3=(EditText) findViewById(R.id.editText3); float from_value= Float.parseFloat(editText2.getText().toString()); editText3.setText( +(from_value * 100.0));
I have this code: EditText value = ( EditText )findViewById( R.id.editbox ); Integer int_value
I save my edditext text: final EditText Zipcodeinput = (EditText) findViewById(R.id.Zipcode); SharedPreferences settings =
I have this piece of code: ed = (EditText) findViewById (R.id.box); int x =
private EditText result = (EditText) findViewById(R.id.editText1); final String[] dropdownList ={a123, b456}; public void onCreate(...)
case DIALOG_ID: AlertDialog.Builder builder = new AlertDialog.Builder(this); EditText edittext=(EditText)findViewById(R.id.name); Appendable name=edittext.getText(); builder.setMessage(name + Certificate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.