In PhotoGalleryFragment add inner class FetchItemsTask and override doInBackground. In PhotoGalleryFragment onCreate start async task