Skip to content

Instantly share code, notes, and snippets.

@cagdasc
Last active May 9, 2018 13:15
Show Gist options
  • Save cagdasc/498dde82d4f838acdaa273831be72942 to your computer and use it in GitHub Desktop.
Save cagdasc/498dde82d4f838acdaa273831be72942 to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCachedThreadPool.openNewPool(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
mCachedThreadPool.closePool(this);
}
public CachedThreadPool getCachedThreadPool() {
return mCachedThreadPool;
}
...
getCachedThreadPool().executeTask(task, MainActivity.this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment