Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // Update the information displayed to the user.
  2. inBackground task = new inBackground ();
  3. task.execute ();
  4. }
  5.  
  6. private class inBackground extends AsyncTask<String, Void, Event> {
  7. protected Event doInBackground(String... urls) {
  8. // Don't perform the request if there are no URLs, or the first URL is null.
  9. if (urls.length < 1 || urls[0] == null) {
  10. return null;
  11. }
  12. Event earthquake = Utils.fetchEarthquakeData (urls[0]);
  13. return earthquake;
  14. }
  15. protected void onPostExecute(Event earthquake) {
  16. //metoda na Ui thread---izvsavamo posle updatea
  17. updateUi (earthquake);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement