protected Event doInBackground(String... urls){ if (urls.length < 1 || urls[0] == null){ return null; } Event result = Utils.fetchEarthquakeData(urls[0]); return result; }
protected void onPostExecute(Event result){ if (result == null){ return; } updateUi(result); }
private class EarthquakeAsyncTask extends AsyncTask{ protected Event doInBackground(String... urls){ if (urls.length < 1 || urls[0] == null){ return null; } Event result = Utils.fetchEarthquakeData(urls[0]); return result; } protected void onPostExecute(Event result){ if (result == null){ return; } updateUi(result); } }