@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View result = inflater.inflate(R.layout.flickr_photo_list, container, false); ListView list = (ListView) result.findViewById(R.id.flickr_photo_list); adapter = new FlickrPhotoListAdapter(); list.setAdapter(adapter); if (currentPhotos != null) adapter.setPhotos(currentPhotos); return result; }
@Override public void onPhotosUpdated(List<Photo> photos) { currentPhotos = photos; if (adapter != null) adapter.setPhotos(currentPhotos); }