[android-developers] Pain taking db reads off UI thread

2011-07-29 Thread Julius Spencer
Hi, I have been trying to take database reads off the UI thread and am currently using an AsyncTask, however I am running into trouble swapping out an updated Cursor for a new one in the adapter. (I was previously using requery() on the Cursor which had to be on the main UI thread) The

Re: [android-developers] Pain taking db reads off UI thread

2011-07-29 Thread Dianne Hackborn
Consider using loaders, for example: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.html On Fri, Jul 29, 2011 at 9:23 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have been trying to take database reads off the UI

Re: [android-developers] Pain taking db reads off UI thread

2011-07-29 Thread Julius Spencer
Hi Dianne, Thank you for the reply. In this example I'm not sure what the baseUri should be : Uri baseUri; if (mCurFilter != null) { baseUri = Uri.withAppendedPath(Contacts.CONTENT_FILTER_URI, Uri.encode(mCurFilter)); }