summaryrefslogtreecommitdiff
path: root/core/java/android/app/FragmentTransaction.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-04-15 19:00:20 -0700
committerDianne Hackborn <hackbod@google.com>2011-04-18 10:18:05 -0700
commit47c4156567ce5abf8a6fca7fefe6ae9a20fb5117 (patch)
treeaccd85c84db9169e2525ea595bb8326d4a14c757 /core/java/android/app/FragmentTransaction.java
parentb0dfade955f2e2e19a827ca2119f3c5d319a824a (diff)
Back-port new fragment detach APIs from support lib.
This allow a much cleaner implementation of things like the fragment pager class. Change-Id: I433be3d6c24c9a059d908d442bcfddbf1e8e57e5
Diffstat (limited to 'core/java/android/app/FragmentTransaction.java')
-rw-r--r--core/java/android/app/FragmentTransaction.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java
index 68600b34ea80..c1f3cd61da1d 100644
--- a/core/java/android/app/FragmentTransaction.java
+++ b/core/java/android/app/FragmentTransaction.java
@@ -87,6 +87,31 @@ public abstract class FragmentTransaction {
public abstract FragmentTransaction show(Fragment fragment);
/**
+ * Detach the given fragment from the UI. This is the same state as
+ * when it is put on the back stack: the fragment is removed from
+ * the UI, however its state is still being actively managed by the
+ * fragment manager. When going into this state its view hierarchy
+ * is destroyed.
+ *
+ * @param fragment The fragment to be detached.
+ *
+ * @return Returns the same FragmentTransaction instance.
+ */
+ public abstract FragmentTransaction detach(Fragment fragment);
+
+ /**
+ * Re-attach a fragment after it had previously been deatched from
+ * the UI with {@link #detach(Fragment)}. This
+ * causes its view hierarchy to be re-created, attached to the UI,
+ * and displayed.
+ *
+ * @param fragment The fragment to be attached.
+ *
+ * @return Returns the same FragmentTransaction instance.
+ */
+ public abstract FragmentTransaction attach(Fragment fragment);
+
+ /**
* @return <code>true</code> if this transaction contains no operations,
* <code>false</code> otherwise.
*/