Android: I can't use a CursorAdapter because of concurrency concerns. What should I do instead? -


thank time. can clear possible, apologies in advance extent fail so.

the situation: creating multithreaded android application deals local database. synchronization/concurrency reasons, want particular activity have no dealings @ cursor. right now, however, uses cursoradapter show data db on screen.

the question: how can replicate functionality of simplecursoradapter without using cursor (because having open cursor introduce concurrency errors)?

(using arraylist of objects work best, have lying around ready play with.)

thank you. stick around , clarify needed.

something may useful:

if want deal cursors in threadsafe way on asynchronous thread (i.e. predictably) try using runonuithread: http://developer.android.com/reference/android/app/activity.html#runonuithread(java.lang.runnable)

the code follows:

activity.runonuithread(new runnable() {            @override            public void run() {                //paste code here            }        }); 

this code go in 1 of asynctask overloads such onpreexecute or doinbackground.

this may allow run non-thread-safe code in more threadsafe manner.

i hope helps!


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -