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 8778613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:34:50+00:00 2026-06-13T19:34:50+00:00

In android, how can get I get a value (that is of type integer)

  • 0

In android, how can get I get a value (that is of type integer) from EditText and insert it into database that has a integer field?

I am using the below code but it doesn’t save integer data into database!

EditText Price;
name = (EditText)findViewById(R.id.txt_GoodsName);
Price = (EditText)findViewById(R.id.txt_Price);
db.insertQuote(name.getText().toString(),Price.getText());

// ----------------------------------------------------------

public long insertQuote(String Quote,int Price1) 
{
    ContentValues initialValues = new ContentValues();
    initialValues.put(GoodName, Quote);
    initialValues.put(Price, Price1);
    return db.insert(DATABASE_TABLE, null, initialValues);
}
  • 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-13T19:34:50+00:00Added an answer on June 13, 2026 at 7:34 pm

    use

    db.insertQuote(name.getText().toString(),Integer.valueOf(Price.getText().toString()));
    

    or

    db.insertQuote(name.getText().toString(),new Integer(Price.getText().toString()));
    

    instead of

     db.insertQuote(name.getText().toString(),Price.getText());
    

    because db.insertQuote(String,Integer) accept second parameter as Integer not as String.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On many Android devices you can get into a secret settings menu from Phone
is there a change that i can get value from my phone's sensor when
I wrote some android application that get xml from some service ( using http
I know how to get a lux value from the light sensor using android.hardware.sensor
Can i get all the events and other informations from android device default calendar
I have a list of items that I get from the database and display
I'm trying to get the value from a Spinner on my android application and
I am fairly new to Android programming and was wondering how I can get
I use asmack to connect with google talk (Android). I can get name, email.
Can i get resolution of android phone..? if yes then how..? it will really

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.