Guest User

Untitled

a guest
Jan 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. private void asyncTaskWithInlineCallback() {
  2.  
  3. // display UI message or indicators
  4. // ...
  5. new MyAsyncTask() {
  6. protected void onPostExecute(EgNetworkResult result) {
  7. // dismiss UI message or indicators
  8. // process the result
  9. // ...
  10. }
  11. }.execute(); // start the background processing
  12.  
  13. }
  14.  
  15. class MyAsyncTask extends AsyncTask<Void, Integer, Boolean> {
  16. @Override
  17. protected Boolean doInBackground(Void... arg0) {
  18. // do background processing and return the appropriate result
  19. // ...
  20. }
  21. }
Add Comment
Please, Sign In to add comment