Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import android.app.Activity;
  2. import android.os.AsyncTask;
  3.  
  4. import cz.pesek.vareni.activity.ActivityMain;
  5.  
  6. public class AsyncTaskCopyDatabase extends AsyncTask<Void, Integer, Void> {
  7.  
  8. //Constructor to get passed values, Context to obtain View, activity to end SplashScreenActivity
  9. public AsyncTaskCopyDatabase(Activity a){
  10. activity = a;
  11. }
  12.  
  13. //Method which runs on Background Thread
  14. @Override
  15. protected Void doInBackground(Void... params) {
  16.  
  17. //TODO: Here do the network intesive job
  18.  
  19. // You can also return something else, but than you must change Type in onPostExecute
  20. return null;
  21. }
  22.  
  23. @Override
  24. protected void onPostExecute(Void v){
  25.  
  26. // UI Thread -> Update Views, etc...
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement