add log message to
initLoader(), onCreateLoader() callback, Loader startLoading()method
onLoadFinished() callback, Loader loadInBackground() method
onLoaderReset() callback, queryUtils fetchEarthquakeData() method
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:divider="@null" android:dividerHeight="0dp"/> <TextView android:id="@+id/empty_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:textAppearance="?android:textAppearanceMedium"/> </RelativeLayout>
private TextView mEmptyStateTextView; @Override protected void onCreate(Bundle savedInstanceState){ mEmptyStateTextView = (TextView) findViewById(R.id.empty_view); earthquakeListView.setEmptyView(mEmptyStateTextView); } @Override public void onLoadFinished(Loader<List<Earthquake>> loader, List<Earthquake> earthquakes){ mEmptyStateTextView.setText(R.string.no_earthquakes); }