Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-02 Thread Nikolay Elenkov
On Tue, Aug 2, 2011 at 2:35 PM, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Tue, Aug 2, 2011 at 2:04 PM, julius jul...@msa.co.nz wrote: Anyhow, after deliverResult I'm guessing onLoadFinished runs. At this point, now the Cursor is refreshed, do we just need to use notifyDatasetChanged

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-02 Thread Dianne Hackborn
Hi, please please please just take the CursorLoader implementation in the support library and modify it to get its cursors from your SQLiteDatabase rather than the content resolver. Unfortunately there are a lot of tricky things you need to do in the AsyncTaskLoader subclass to get it to work

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-02 Thread Nikolay Elenkov
On Tue, Aug 2, 2011 at 4:31 PM, Dianne Hackborn hack...@android.com wrote: Hi, please please please just take the CursorLoader implementation in the support library and modify it to get its cursors from your SQLiteDatabase rather than the content resolver.  Unfortunately there are a lot of

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-01 Thread Julius Spencer
Hi, I can't figure out how to use this if I am using a SQLiteDatabase which isn't set up as a ContentProvider. From what I remember there won't be source for Honeycomb released anytime soon so I'm not sure how I could use the Loader framework to make it work. Regards, Julius. On

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-01 Thread Nikolay Elenkov
On Mon, Aug 1, 2011 at 6:13 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, I can't figure out how to use this if I am using a SQLiteDatabase which isn't set up as a ContentProvider.  From what I remember there won't be source for Honeycomb released anytime soon so I'm not sure how I could

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-01 Thread Kostya Vasilyev
How about: Take the source for AsyncQueryHandler http://developer.android.com/reference/android/content/AsyncQueryHandler.html ... and make modifications to work directly with a SQLiteDatabase object? You could also look at AsyncTaskLoader, specifically, this example which doesn't use a

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-01 Thread julius
Thanks for the replies. If I have a Cursor, where and how would I go about swapping the old Cursor for the new one? It appears that loadInBackground returns a new Cursor and after this deliverResult runs which closes the old Cursor and makes the swaps in the new Cursor. It looks like in

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-08-01 Thread Nikolay Elenkov
On Tue, Aug 2, 2011 at 2:04 PM, julius jul...@msa.co.nz wrote: It appears that loadInBackground returns a new Cursor and after this deliverResult runs which closes the old Cursor and makes the swaps in the new Cursor. Right. That's exactly what CursorLoader.deliverResult() does. It looks

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-07-31 Thread H
You simply call getSupportLoaderManager() which you inherit from FragmentActivity. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-07-26 Thread Julius Spencer
Hi, I'm planning on going down the path of making a SQLiteLoader. The question I have is how do I access the LoaderManager. I have a ListActivity and have the compatibility library set up, but can't figure out how to initialise my loader. Regards, Julius. On 21/07/2011, at 5:10 AM, Mark

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-07-20 Thread Mark Murphy
On Wed, Jul 20, 2011 at 12:59 PM, Julius Spencer jul...@msa.co.nz wrote: The CursorLoader documentation describes itself as: A loader that queries the ContentResolver and returns a Cursor. Does anyone know if it's possible to use a CursorLoader for an application's SQLiteDatabase? It should

Re: [android-developers] Use CursorLoader for SQLiteDatabase?

2011-07-20 Thread Julius Spencer
Thank you for the reply I will let you know how I get on. On 21/07/2011, at 5:10 AM, Mark Murphy wrote: On Wed, Jul 20, 2011 at 12:59 PM, Julius Spencer jul...@msa.co.nz wrote: The CursorLoader documentation describes itself as: A loader that queries the ContentResolver and returns a