Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sujewan/e710fe956f82fb7d50b0 to your computer and use it in GitHub Desktop.
Save sujewan/e710fe956f82fb7d50b0 to your computer and use it in GitHub Desktop.
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