Skip to content

Instantly share code, notes, and snippets.

@benigumocom
Created January 16, 2014 12:44
Show Gist options
  • Save benigumocom/8454426 to your computer and use it in GitHub Desktop.
Save benigumocom/8454426 to your computer and use it in GitHub Desktop.
One-Shot Loader
// 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);
}
}
@benigumocom
Copy link
Author

例:送信フォーム

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment