This should happen automatically if you use the ArrayAdapter's
add/insert/remove methods to modify the data set.


On Mon, Feb 16, 2009 at 1:44 PM, Jiri <[email protected]> wrote:
>
> Hello,
>
> I'm facing to one problem with ListView. I would like to refresh the
> ListView every time I change the base data. Please see the following
> example:
>
> @Override
> public void onCreate(Bundle savedInstanceState) {
>        super.onCreate(savedInstanceState);
>
>        setListAdapter(new ArrayAdapter<Object>(this,
>                        android.R.layout.simple_list_item_1, mStrings));
>
>        new Timer().scheduleAtFixedRate(new TimerTask() {
>                public void run() {
>                        Log.d(TAG, "running timer: num=" + num);
>                        mStrings[0] = "Unpdate " + num;
>                        num++;
>
>                        /** refresh the ListView - HOW??? **/
>                        //TestList.this.getListView().invalidateViews();
>                        //TestList.this.getListView().refreshDrawableState();
>                        // what else???
>                }
>        }, 5000, 2000);
> }
>
> Can somebody give me a hint how to implement this feature?
>
> Best regards,
> Jiri
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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