Created
April 19, 2015 13:31
-
-
Save yishai-glide/1e8fe8021e679f8ca2ed to your computer and use it in GitHub Desktop.
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 MyAsyncTask extends AsyncTask { | |
WeakReference<MyActivityInterface> mCaller; | |
public MyAsyncTask(MyActivityInterface caller) { | |
mCaller = caller; | |
} | |
// here comes code | |
public void onPostExecute(Object result) { | |
if(mCaller.get() != null) { | |
mCaller.doSomething(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment