Created
August 7, 2016 11:07
-
-
Save vsvankhede/2b12592ce3b6a3f2853fffd578c24768 to your computer and use it in GitHub Desktop.
Demo Activity implements loader callback.
This file contains 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
public class DemoActivity extends Activity implements LoaderManager.LoaderCallbacks<T> { | |
private static final int LOADER_ID = 1; | |
public void onCreate(Bundle savedInstanceState) { | |
getLoaderManager().initLoader() | |
} | |
public Loader<T> onCreateLoader(Loader<T> loader, T data) { | |
// Create the loader | |
} | |
public void onLoadFinished(Loader<T> loader,T data) { | |
// User the delivered data. | |
} | |
public void onLoaderReset(Loader<T> loader) { | |
// The loader data is invalid, stop using it. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment