Skip to content

Instantly share code, notes, and snippets.

@nex3z
Created November 4, 2016 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nex3z/d3decfadb565403bc248600ee4b660dc to your computer and use it in GitHub Desktop.
Save nex3z/d3decfadb565403bc248600ee4b660dc to your computer and use it in GitHub Desktop.
static class MyHandler extends Handler {
private final WeakReference<MyActivity> mRef;
MyHandler(MyActivity activity) {
mRef = new WeakReference<HomeActivity>(activity);
}
@Override
public void handleMessage(Message msg) {
MyActivity activity = mRef.get();
if (activity != null) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment