开发者

How to clean listitem data in ListActivity when using extends BroadcastReceiver

Anyway to clean listitem data inside ListActivity and then show data using setListAdapter(adapter) ? The problem is it continuously appends listitem data inside ListActivity and show many listitem data. I used android.widget.SimpleAdapter for adapter. I want to clean data and then show data.

class Receiver extends BroadcastReceiver {   
        public void onReceive(Context c, Intent intent){
             adapter.notifyDataSetChanged()开发者_如何学Go;
              ........

            }   
            setListAdapter(adapter);  
        }   
    }   


you should use

adapter.notifyDataSetChanged();

http://developer.android.com/reference/android/widget/BaseAdapter.html#notifyDataSetChanged()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜