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
private final LoaderCallbacks<Result> loaderCallbacks = new LoaderCallbacks<Result>() { | |
@Override | |
public Loader<Result> onCreateLoader(int id, Bundle args) { | |
return new MyLoader(getActivity(), args.getLong("id")); | |
} | |
@Override | |
public void onLoadFinished(Loader<Result> loader, Result result) { | |
handleResult(result); |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
... | |
getSupportLoaderManager().initLoader(LOADER_ID, null, callbacks); | |
} |
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
@Override | |
public void onActivityCreated(Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
... | |
getLoaderManager().initLoader(LOADER_ID, null, callbacks); | |
} |
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
private void onNewQuery(String query) { | |
Bundle args = new Bundle(); | |
args.putString("query", query); | |
getLoaderManager().restartLoader(LOADER_ID, args, loaderCallbacks); | |
} | |
@Override | |
public Loader<Result> onCreateLoader(int id, Bundle args) { | |
return new QueryLoader(getActivity(), args.getString("query")); | |
} |
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
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
this.newsId = getArguments().getLong("newsId"); | |
} | |
... | |
@Override | |
public Loader<News> onCreateLoader(int id, Bundle args) { | |
return new NewsLoader(getActivity(), NewsFragment.this.newsId); |
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 作成時 |
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
#!/bin/sh -x | |
adb pull /sdcard/DCIM/Vine . | |
for file in `ls -1 *.mp4` | |
do | |
echo "file '${file}'" >> input.txt | |
done; | |
ffmpeg -f concat -i input.txt -c copy output.mp4 |
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
https://gist.github.com/benigumocom/8454426 | |
↓ | |
<script src="http://gist.github.com/8454426.js"></script> |
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
public class LinesFragment extends ContextMenuSherlockListFragment implements LoaderCallbacks<List<LineInfo>>, Callback { | |
... | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
handler = new Handler(this); | |
adapter = new LinesAdapter(getActivity()); | |
} |
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
<?php | |
/** | |
Restructure dirs/files tree. | |
https://github.com/google/material-design-icons | |
Usage: | |
$ curl -LO https://github.com/google/material-design-icons/archive/master.zip |