I have a little problem getting the id from the added row.
insertWithConflictinside my ContentProviderreturns the identifier of the line just added, but I donβt know how to get this from mine ContentProviderto mine IntentService, responsible for including the insert.
CODE
Paste in IntentService
Uri uri = Uri.parse(MicroDatabaseProvider.CONTENT_URI + "/" + MicroDatabaseProvider.ORGANIZER_SEARCH_IN);
getContentResolver().insert(uri, cv);
Paste in ContetnProvider
long idLong = sqlDB.insertWithOnConflict(DbHelperMicro.ORGANIZER_SEARCH_TABLE,
null,
values,
SQLiteDatabase.CONFLICT_IGNORE);
getContext().getContentResolver().notifyChange(Uri.parse(CONTENT_URI + "/" + ORGANIZER_SEARCH_QUE), null);
source
share