Last active
December 10, 2015 08:08
-
-
Save galex/4406148 to your computer and use it in GitHub Desktop.
Skeleton of a map fragment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.fragment; | |
public class PlaceMapFragment extends RefreshMapFragment implements LoaderCallbacks<List<Category>> { | |
private static final int LOADER_ID = 613; | |
@Override | |
public void onActivityCreated(Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
getSherlockActivity().getSupportLoaderManager().initLoader(LOADER_ID, null, this); | |
} | |
@Override | |
public Loader<List<Category>> onCreateLoader(int id, Bundle bundle) { | |
setRefreshing(true); | |
return new CategoryLoader(getSherlockActivity()); | |
} | |
@Override | |
public void onLoadFinished(Loader<List<Category>> loader, List<Category> data) { | |
// WHEN GETTING DATA, we're going to put the places (contained by the Category model object) on our map | |
setRefreshing(false); | |
} | |
@Override | |
public void onLoaderReset(Loader<List<Category>> loader) { | |
} | |
@Override | |
public void onRefresh() { | |
getSherlockActivity().getSupportLoaderManager().restartLoader(LOADER_ID, null, this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment