rest - Android LoaderManager ContentProvider and loading data over network -


i've searched stackoverflow , googled can't find answer.

i'm trying build rest-service using virgil dobjanschis designpattern b ( http://www.google.com/events/io/2010/sessions/developing-restful-android-apps.html)

i have activity simplecursoradapter , loadermanager query contentprovider. works data in database. data re-queried , ui getting refreshed.

after every query on contentprovider thread started sync requested data network, loads json-objects, parses , save new data database - fine, ui not updated.

i think have send activity message refresh data, don't know how , can't find example how that.

so, right way manage this?

---- updated ----

i think didn't explain problem clearly. can see in pic:

enter image description here

step 7 working. helper-class updating data. step 7' not happen. thought automatic feature of contentprovider.

my helper-class (resthandler) updating database directly without using contentprovider.

you have simplecursoradapter, suppose use bind data content provider ui, correct? if that's true, need move retrieved cursor cursor adapter every time update cursor.

do in cursorloader.onloadfinished(), calling either

simplecursoradapter.swapcursor() or simplecursoradapter.changecursor().

see android training class loading data in background complete example.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -