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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:20:12+00:00 2026-06-14T15:20:12+00:00

Possible Duplicate: Error inserting in SQLite database Hi…………. I am new for Android, right

  • 0

Possible Duplicate:
Error inserting in SQLite database

Hi………….
I am new for Android, right now i am working with android database. I want to insert some hard-coded value in my database , by call a method.

     public void insertdata(String ti, String de) {
    ContentValues userdetailValues = new ContentValues(); 
    userdetailValues.put("tick", ti);
    userdetailValues.put("des",de);
    dh.insert(DatabaseHelper.TABLE_NAME, null, userdetailValues);
    } 

Above method is define in a activity out on onCreate() block. When i am going to call this method within onCreate() block as

 insetdata(aaa,bbb);

Then it show a error for me-

    aaa can not be resolve to variable and same for bbb.

As i told that i am new for Android , and quite afraid, in that case if it is small issue , then please help me ,i am just a learner .
Thanks in Advance to all.

  • 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-14T15:20:13+00:00Added an answer on June 14, 2026 at 3:20 pm

    Try this

    public void addContact(Contact contact) {
            SQLiteDatabase db = this.getWritableDatabase();
    
            ContentValues values = new ContentValues();
            values.put(KEY_NAME, contact.getName()); // Contact Name
            values.put(KEY_PH_NO, contact.getPhoneNumber()); // Contact Phone Number
    
            // Inserting Row
            db.insert(TABLE_CONTACTS, null, values);
            db.close(); // Closing database connection
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: error is showing for Digital Clock widget Application in Android I want
Possible Duplicate: Error : get property of non-object I am new to codeigniter model,
Possible Duplicate: @Override annotation error (android prefs) I have imported a project into my
Possible Duplicate: Error while adding records to access database from c#.net I need to
Possible Duplicate: Exceptions or error codes Hi, I am looking for some guidelines on
Possible Duplicate: Error loading Active Record gem with sinatra app using RVM I have
Possible Duplicate: Make error: missing separator I am so stressed out by this silly
Possible Duplicate: getElementById.contentDocument error in IE listed below is my javascript code. What it
Possible Duplicate: Why is it an error to use an empty set of brackets
Possible Duplicate: Foursquare API for venue user image error I first noticed this problem

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.