Advertisement
Guest User

Untitled

a guest
Oct 21st, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class MyAsyncTaskClass extends AsyncTask {
  2. private ProgressDialog referenceToDialogFromAnotherClass;
  3.  
  4. public MyAsyncTaskClass(ProgressDialog dialogFromAnotherClass) {
  5. this.referenceToDialogFromAnotherClass = dialogeFromAnotherClass;
  6. }
  7.  
  8. @Override
  9. public void onPostExecute() {
  10. this.referenceToDialogFromAnotherClass.show();
  11. // Do other stuff with the dialog like setting a title or text or something.
  12. }
  13.  
  14. @Override
  15. public void doInBackground(args...) {
  16. // Do stuff in the background here.
  17. }
  18.  
  19. @Override
  20. public void onPreExecute() {
  21. // We're done, so let's remove the dialog again.
  22. this.referenceToDialogFromAnotherClass.dismiss();
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement