The insert
method returns the id
of row just inserted or -1
if there was an error during insertion.
long id = db.insert(...);
where db is SQLiteDatabase
.
More Related Contents:
- Can’t add parameter ‘this’
- How to use an existing database with an Android application [duplicate]
- SQlite Getting nearest locations (with latitude and longitude)
- Any good ORM tools for Android development? [closed]
- Simple export and import of a SQLite database on Android
- Foreign key constraints in Android using SQLite? on Delete cascade
- SQLite in Android How to update a specific row
- Using Singleton design pattern for SQLiteDatabase
- Database not copying from assets
- Android search with Fragments
- Which Android Data Storage Technique to use?
- How to persist permission in android API 19 (KitKat)?
- Upgrade SQLite database from one version to another?
- Android: Cannot perform this operation because the connection pool has been closed
- SQLiteOpenHelper failing to call onCreate?
- What is the use of BaseColumns in Android
- What is the correct way to do inserts/updates/deletes in Android SQLiteDatabase using a query string?
- Android : Table has no column named “variable name” MySql Database error
- android.database.sqlite.SQLiteException: no such column
- UNIQUE constraint failed: sqlite database : android
- How To Test If Cursor Is Empty in a SQLiteDatabase Query
- android.database.CursorWindowAllocationException when moving a Cursor
- Read data from SQLite where column name contains spaces
- Is it OK to have one instance of SQLiteOpenHelper shared by all Activities in an Android application?
- Mapbox Greyed out on dialog/Popup [closed]
- Android RecyclerView Scrolling Performance
- RecyclerView not calling onCreateViewHolder or onBindView
- How to print to the console in Android Studio?
- Cant start service? (Speech recog)
- android studio with Java compiler error: string too large to encode using UTF-8 written instead as ‘STRING_TOO_LARGE’