• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Sqlite AUTOINCREMENT

When you create the table in SQLite, just specify
create table <your_table_nam> (<key_id> integer primary key autoincrement

Then when you create a new record, for the insert statement you don't need to specify the <key_id> field. Android/SQLite will add the next available integer as the key automatically for you.

Hope this helps.

Shengxin
 
Back
Top Bottom