New API demos showing use of tabs with fragments.
Also various cleanup in other demos.
Change-Id: I4f5669117e28312bcd4b28795c5eca5f4ab6dcfb
diff --git a/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.java b/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.java
index 07b9309..096316c 100644
--- a/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.java
+++ b/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.java
@@ -81,6 +81,9 @@
new int[] { android.R.id.text1, android.R.id.text2 }, 0);
setListAdapter(mAdapter);
+ // Start out with a progress indicator.
+ setListShown(false);
+
// Prepare the loader. Either re-connect with an existing one,
// or start a new one.
getLoaderManager().initLoader(0, null, this);
@@ -147,6 +150,13 @@
// Swap the new cursor in. (The framework will take care of closing the
// old cursor once we return.)
mAdapter.swapCursor(data);
+
+ // The list should now be shown.
+ if (isResumed()) {
+ setListShown(true);
+ } else {
+ setListShownNoAnimation(true);
+ }
}
public void onLoaderReset(Loader<Cursor> loader) {