Well actually the SQLiteDatabase class has its own insert method which returns the id of the newly created row. I think this is the best way to get the new ID.
You can check its documentation here.
I hope this helps.
More Related Contents:
- When does SQLiteOpenHelper onCreate() / onUpgrade() run?
- Where does Android emulator store SQLite database?
- How to store(bitmap image) and retrieve image from sqlite database in android? [closed]
- Android SQLite Example [closed]
- Android database encryption
- How do I join two SQLite tables in my Android application?
- Android SQLite issue – table … has no column named
- Android error – close() was never explicitly called on database
- How do I create a database in android? [closed]
- What is a maximum size of SQLite database on Android?
- How to save images into Database
- Full text search example in Android
- Android SimpleCursorAdapter doesn’t update when database changes
- rawQuery(query, selectionArgs)
- How to implement Export sqlite To excel/csv file in android?
- How to store and retrieve a byte array (image data) to and from a SQLite database?
- SQLite Query in Android to count rows
- App Crashes On Startup Due To java.lang.IllegalArgumentException: column ‘_id’ does not exist
- How does one check if a table exists in an Android SQLite database?
- Could not allocate CursorWindow
- how to save image taken from camera and show it to listview – crashes with “IllegalStateException”
- When should I do certain SQLite operations on another thread(not the main thread)?
- How to view data saved in android database(SQLite)?
- Changing values from Cursor using SimpleCursorAdapter
- SQLite exception: Database is locked issue
- How can I reset a autoincrement sequence number in sqlite
- Sqlite issues with HTC Desire HD
- H2 Database vs SQLite on Android [closed]
- Get SQLite database from Android app
- Backup Room database