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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:42:04+00:00 2026-06-17T16:42:04+00:00

My database creates and populates without any problems. I even have a custom adapter

  • 0

My database creates and populates without any problems. I even have a custom adapter to display the rows in listviews in my activity.
The problem is my _id column doesn’t actually have any ids.
I have a dialogue box come up on listItemClick with the data being put into text boxes, there are buttons at the bottom, I’m trying to get the ‘delete’ button to work so the user can delete that record. I’m trying to delete the record calling the _id however the ID column of my database is empty for all my records. The dialogue box displays the ID number for each item and they come up as 0 for all of them and when I open the database with sqlite database browser the id column is completely empty for every record. Can anyone please help and tell me why this is?
This is the tutorial I used:
http://android-er.blogspot.co.uk/2011/06/edit-row-in-sqlite-database-using.html

Some code:

Creating database and table:

     public static final String KEY_ID = "_id";
     public static final String KEY_LESSON = "Lesson";
     public static final String KEY_DAY = "Day";
     public static final String KEY_START = "Start";
     public static final String KEY_END = "End";
     public static final String KEY_LOCATION = "Location";

     private SQLiteDatabase db;
     private DBHelper dbHelper;
     private final Context context;

     private static final String DATABASE_CREATE = "create table Schedule" + " (" + KEY_ID + " INTERGER PRIMARY KEY," 
     + KEY_LESSON + " text not null, " + KEY_DAY + " text not null," + KEY_START + " text not null, " + KEY_END 

public void deleteEntry(int id) {

  db.delete(DATABASE_TABLE, KEY_ID + "=" +id, null);

 }

Dialogue:

      myDialog.setPositiveButton("Delete", new DialogInterface.OnClickListener() {

      public void onClick(DialogInterface arg0, int arg1) {

      db.open();
  db.deleteEntry(item_id);

  }
  });
  • 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-17T16:42:04+00:00Added an answer on June 17, 2026 at 4:42 pm

    This is wrong:

    " INTERGER PRIMARY KEY,"
    

    This would be better:

    " INTEGER PRIMARY KEY AUTOINCREMENT,"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have (java) code that creates and populates tables in a derby database, using
I have an app that creates a database and do some stuff. I am
I have an app that creates a SQLite database ( with 24 records ),
I have a small php file which just creates the tables in a database.
We have a local database of our products without the price. To get the
I have two sql files: The first one creates database, tables, and stored procedures.
I have been trying to figure this problem out without asking for help, but
I have a table (Major) without any foreign keys and just two fields: ID
I'm trying to create a drop down list that populates from a database. I
I want to create an SQL script that creates a database. Right now, I

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.