Well, you get 100 cool points for knowing that you should use
AsyncTask, to let the query run in the background.

It seems odd that the list populating makes the UI stuck for a while.
Can you give us an estimate of how many rows and columns are in your
list, and how long the UI is stuck while it's being populated?

-- PJ


On Oct 29, 4:11 am, Hilly <hi...@labpixies.com> wrote:
> Hi,
>
> It will be great if someone here will know how to help me with the
> issue bellow.
>
> What is the best way to display a database queries results on the
> screen using ListActivity? I need the db queries to run in the
> background and I also need to be able to make different queries and
> refresh the screen according to the query result.
>
> I am using the ListActivity class with a SimpleCursorAdapter in order
> to display the db queries result on the screen.
> At the moment, I am doing the db queries at the background using
> AsyncTask, when getting the results I want the list to be updated
> immediately, but I can't find a good way to do it.
> It worked only when I used the changeCursor(cursor) function to set
> the adapter to a new cursor with the new results. But I don't think
> this is a good solution since it seems to stuck the UI for a while.
> I also found some posts about notifyDataSetChanged() but I am not sure
> if/how/when I should be using it with a SimpleCursorAdapter to make
> the view refresh.
>
> Can anyone tell what I am doing wrong? Or give a code example or link
> to something like this that works?
>
> Thanks!
> Hilly

-- 
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 email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to