android - Returning _id from SQLite update using SQLiteCursorLoader -


i'm refactoring android work-in-progress app use loader framework, , since data stored in sqlite database i'm using commonsware loaderex package , sqlitecursorloader rather contentprovider layer.

the insert(..), update(..) etc methods in sqlitecursorloader have void return type. make life easier , code neater if returned long, being autoincremented row id of row in table had been amended.

i hack sqlitecursorloader this, wondered if there design reason doesn't @ moment? in case stuck in , hit big gotcha.

i wondered if there design reason doesn't @ moment?

sure. methods actual work in asynctask, , therefore cannot return value seek.

you welcome own asynctask perform operations , deal values, assuming underlying sqlite apis support (i don't think can value want update, since there multiple rows might affected). have call oncontentchanged() on sqlitecursorloader yourself, trigger logic re-query database , deliver fresh cursor.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -