For a ListActivity, try onContentChanged().

On Thu, Nov 11, 2010 at 3:33 PM, Kumar Bibek <[email protected]> wrote:
> Try notifyDatasetChanged(). This should be called whenever the backing data
> us changed
>
> On 12-Nov-2010 2:01 AM, "jotobjects" <[email protected]> wrote:
>
> I have an ListActivity with a BaseAdapter where the contents have
> changed (example - the rows are reordered).  I have tried
> invalidate(),  invalidateViews(), and notifyDataSetInvalidated(). So
> far no luck...
>
> The ListView does not repaint.  getView() in the Adapter is not
> called.
>
> There are some similar posts but I did not see an answer.  Have tried
> with and without the runOnUiLoop() call.
>
> Does anyone see what I should do differently?
>
> public class MyListActivity extends ListActivity
> {
>    public void onCreate(Bundle icicle)
>    {
>        setListAdapter(new MyAdapter());
>    }
>
>    MyListener registryListener = new  MyListener registryListener ()
>    {
>       �...@override
>        public void onChange(String eventName)
>        {
>           . . . . do some work . . .
>           runOnUiThread(new Runnable () {
>                public void run ()
> { getListView().invalidateViews(); }
>            });
>        }
>    };
>
>    class MyAdapter extends BaseAdapter
>    {
>        public View getView(. . .)
>        {
>        }
>    }
> }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to