Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update the information displayed to the user.
- inBackground task = new inBackground ();
- task.execute ();
- }
- private class inBackground extends AsyncTask<String, Void, Event> {
- protected Event doInBackground(String... urls) {
- // Don't perform the request if there are no URLs, or the first URL is null.
- if (urls.length < 1 || urls[0] == null) {
- return null;
- }
- Event earthquake = Utils.fetchEarthquakeData (urls[0]);
- return earthquake;
- }
- protected void onPostExecute(Event earthquake) {
- //metoda na Ui thread---izvsavamo posle updatea
- updateUi (earthquake);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement