Created
January 16, 2014 12:44
-
-
Save benigumocom/8454426 to your computer and use it in GitHub Desktop.
One-Shot Loader
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
// LoaderCallbacks | |
@Override | |
public void onLoadFinished(Loader<Integer> loader, Result result) { | |
getLoaderManager().destroyLoader(LOADER_ID); | |
... // Process the result | |
} | |
// Activity/Fragment 作成時 | |
@Override | |
public void onActivityCreated(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
... | |
// Reconnect to the loader only if present | |
if (getLoaderManager().getLoader(LOADER_ID) != null) { | |
getLoaderManager().initLoader(LOADER_ID, null, this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
例:送信フォーム