本文整理汇总了Java中android.widget.BaseAdapter.notifyDataSetInvalidated方法的典型用法代码示例。如果您正苦于以下问题:Java BaseAdapter.notifyDataSetInvalidated方法的具体用法?Java BaseAdapter.notifyDataSetInvalidated怎么用?Java BaseAdapter.notifyDataSetInvalidated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.BaseAdapter
的用法示例。
在下文中一共展示了BaseAdapter.notifyDataSetInvalidated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showAlbums
import android.widget.BaseAdapter; //导入方法依赖的package包/类
private void showAlbums() {
if (albums == null) {
return;
}
ThumbnailClickListener<Album> foo = new ThumbnailClickListener<Album>() {
@Override
public void thumbnailClicked(Album album) {
doPhotosRequest(album.getName(), album.getGdataUrl());
}
};
mainList.setAdapter(new AlbumsAdapter(wrap(albums), inflater, foo,
cachedImageFetcher, getResources().getDisplayMetrics()));
BaseAdapter adapter = (BaseAdapter) mainList.getAdapter();
adapter.notifyDataSetChanged();
adapter.notifyDataSetInvalidated();
mainList.invalidateViews();
}
示例2: loadPhotos
import android.widget.BaseAdapter; //导入方法依赖的package包/类
private void loadPhotos() {
if (photos == null) {
Log.d(TAG, "No photos!");
return;
}
ThumbnailClickListener<Photo> clickListener = new ThumbnailClickListener<Photo>() {
@Override
public void thumbnailClicked(Photo photo) {
loadPhoto(photo);
}
};
mainList.setAdapter(new PhotosAdapter(wrap(photos), inflater,
clickListener, cachedImageFetcher, this.getResources()
.getDisplayMetrics()));
BaseAdapter adapter = (BaseAdapter) mainList.getAdapter();
adapter.notifyDataSetChanged();
adapter.notifyDataSetInvalidated();
mainList.invalidateViews();
}