开发者

Android ListView AdddAll problem

开发者 https://www.devze.com 2023-03-06 12:57 出处:网络
hi i am Using ArrayAdapter in ListView with custom Class object,HERE IS MY CODE private static class NewsDetailAdapter extends ArrayAdapter<clsNewsItem>

hi i am Using ArrayAdapter in ListView with custom Class object,HERE IS MY CODE

private static class NewsDetailAdapter extends ArrayAdapter<clsNewsItem>
{
private final Activity context;
    List<clsNewsItem> newsList = null;
        public NewsDetailAdapter(Activity context,  ArrayList<clsNewsItem> clsNewsObjects) {
        super(context, R.layout.listview_cell, clsNewsObjects);
        this.context = context;
        this.newsList = clsNewsObjects;
    }
 public void clear()
    {
        newsList.clear();

    }

while i am working with this code AdapterObj.NotifyDatasetchanged() not working Due to i have not implemented addAll() method for this class,i cant understand how to write this Method so how can i Write Add All 开发者_开发技巧method for this ArrayAdaper class..can Any one help me please


Do you have specific need for subclassing? If you need to have some logic better have one ArrayAdapter as member instance and proxy its methods. Because the original ArrayAdapter already has all these methods readily available

0

精彩评论

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