Created
May 12, 2014 12:31
-
-
Save sujewan/e710fe956f82fb7d50b0 to your computer and use it in GitHub Desktop.
This file contains 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 LongOperation extends AsyncTask<String, Integer, String> | |
{ | |
... | |
@Override | |
protected String doInBackground(String... params) | |
{ | |
SomeClass.doStuff(this); | |
return null; | |
} | |
... | |
public void doProgress(int value) | |
{ | |
publishProgress(value); | |
} | |
} | |
... | |
public class SomeClass | |
{ | |
public static void doStuff(LongOperation task) | |
{ | |
// do stuff | |
task.doProgress(1); | |
// more stuff etc | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment