summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-06-16 15:25:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-16 15:25:22 -0700
commit872a1e793c2bd218c1ad1f485f3a76974c72a547 (patch)
treee61d8ac13fa6e990a5d6ff45a74e88a42e850af5 /core/java
parent810dc5980c504a89974c07fcbd28a2b5dffb47de (diff)
parent9a73c4d3a9c7ce02f80b078ca9ba5106234ecd9c (diff)
downloadframeworks_base-872a1e793c2bd218c1ad1f485f3a76974c72a547.zip
frameworks_base-872a1e793c2bd218c1ad1f485f3a76974c72a547.tar.gz
frameworks_base-872a1e793c2bd218c1ad1f485f3a76974c72a547.tar.bz2
am 9a73c4d3: am 2f04883f: SDK only: integrate new sample code, deprecating along the way.
* commit '9a73c4d3a9c7ce02f80b078ca9ba5106234ecd9c': SDK only: integrate new sample code, deprecating along the way.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActionBar.java6
-rw-r--r--core/java/android/app/ActivityGroup.java5
-rw-r--r--core/java/android/app/LocalActivityManager.java7
-rw-r--r--core/java/android/app/TabActivity.java28
4 files changed, 44 insertions, 2 deletions
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index fc5fac6..9473e9b 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -400,6 +400,12 @@ public abstract class ActionBar {
* Create and return a new {@link Tab}.
* This tab will not be included in the action bar until it is added.
*
+ * <p>Very often tabs will be used to switch between {@link Fragment}
+ * objects. Here is a typical implementation of such tabs:</p>
+ *
+ * {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentTabs.java
+ * complete}
+ *
* @return A new Tab
*
* @see #addTab(Tab)
diff --git a/core/java/android/app/ActivityGroup.java b/core/java/android/app/ActivityGroup.java
index f1216f9..9444113 100644
--- a/core/java/android/app/ActivityGroup.java
+++ b/core/java/android/app/ActivityGroup.java
@@ -23,8 +23,13 @@ import android.os.Bundle;
import android.util.Log;
/**
+ * @deprecated Use the new {@link Fragment} and {@link FragmentManager} APIs
+ * instead; these are also
+ * available on older platforms through the Android compatibility package.
+ *
* A screen that contains and runs multiple embedded activities.
*/
+@Deprecated
public class ActivityGroup extends Activity {
private static final String TAG = "ActivityGroup";
private static final String STATES_KEY = "android:states";
diff --git a/core/java/android/app/LocalActivityManager.java b/core/java/android/app/LocalActivityManager.java
index c958e1b..0a6b804 100644
--- a/core/java/android/app/LocalActivityManager.java
+++ b/core/java/android/app/LocalActivityManager.java
@@ -28,12 +28,17 @@ import java.util.HashMap;
import java.util.Map;
/**
- * Helper class for managing multiple running embedded activities in the same
+ * @deprecated Use the new {@link Fragment} and {@link FragmentManager} APIs
+ * instead; these are also
+ * available on older platforms through the Android compatibility package.
+ *
+ * <p>Helper class for managing multiple running embedded activities in the same
* process. This class is not normally used directly, but rather created for
* you as part of the {@link android.app.ActivityGroup} implementation.
*
* @see ActivityGroup
*/
+@Deprecated
public class LocalActivityManager {
private static final String TAG = "LocalActivityManager";
private static final boolean localLOGV = false;
diff --git a/core/java/android/app/TabActivity.java b/core/java/android/app/TabActivity.java
index 033fa0c..0fd0c2c 100644
--- a/core/java/android/app/TabActivity.java
+++ b/core/java/android/app/TabActivity.java
@@ -23,8 +23,34 @@ import android.widget.TabWidget;
import android.widget.TextView;
/**
- * An activity that contains and runs multiple embedded activities or views.
+ * @deprecated New applications should use Fragments instead of this class;
+ * to continue to run on older devices, you can use the v4 support library
+ * which provides a version of the Fragment API that is compatible down to
+ * {@link android.os.Build.VERSION_CODES#DONUT}.
+ *
+ * <p>For apps developing against {@link android.os.Build.VERSION_CODES#HONEYCOMB}
+ * or later, tabs are typically presented in the UI using the new
+ * {@link ActionBar#newTab() ActionBar.newTab()} and
+ * related APIs for placing tabs within their action bar area.</p>
+ *
+ * <p>A replacement for TabActivity can also be implemented by directly using
+ * TabHost. You will need to define a layout that correctly uses a TabHost
+ * with a TabWidget as well as an area in which to display your tab content.
+ * A typical example would be:</p>
+ *
+ * {@sample development/samples/Support4Demos/res/layout/fragment_tabs.xml complete}
+ *
+ * <p>The implementation needs to take over responsibility for switching
+ * the shown content when the user switches between tabs.
+ *
+ * {@sample development/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.java
+ * complete}
+ *
+ * <p>Also see the <a href="{@docRoot}resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html">
+ * Fragment Tabs Pager</a> sample for an example of using the support library's ViewPager to
+ * allow the user to swipe the content to switch between tabs.</p>
*/
+@Deprecated
public class TabActivity extends ActivityGroup {
private TabHost mTabHost;
private String mDefaultTab = null;