app/src/main/java/com/example/android/quakereport/EarthquakeActivity.java
/**
         * This method runs on the main UI thread after the background work has been
         * completed. This method receives as input, the return value from the doInBackground()
         * method. First we clear out the adapter, to get rid of earthquake data from a previous
         * query to USGS. Then we update the adapter with the new list of earthquakes,
         * which will trigger the ListView to re-populate its list items.
         */
This method runs on the main UI thread after the background work has been
completed. This method receives as input, the return value from the doInBackground()
method. First we clear out the adapter, to get rid of earthquake data from a previous
query to USGS. Then we update the adapter with the new list of earthquakes,
which will trigger the ListView to re-populate its list items.
This method runs on the main UI thread after the background work has been completed . This method receives as input the return value from the doInBackground () method . First we clear out the adapter to get rid of earthquake data from a previous query to USGS . Then we update the adapter with the new list of earthquakes which will trigger the ListView to re - populate its list items .
@Override
        protected void onPostExecute(List<Earthquake> data) {
            mAdapter.clear();
            if (data != null && !data.isEmpty()) {
                mAdapter.addAll(data);
                if (dialog.isShowing()) {
                    dialog.dismiss();
                }
            }
        }
@ Override protected void onPostExecute ( List < Earthquake > data ) { mAdapter . clear ( ) ; if ( data != null && ! data . isEmpty ( ) ) { mAdapter . addAll ( data ) ; if ( dialog . isShowing ( ) ) { dialog . dismiss ( ) ; } } }
This method runs on the main UI thread after the background work has been
 completed.
This method runs on the main UI thread after the background work has been completed .
// Clear the adapter of previous earthquake data // If there is a valid list of {@link Earthquake}s, then add them to the adapter's // data set. This will trigger the ListView to update.