History log of /frameworks/base/core/java/android/app/Fragment.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a0ffafffdd3a051edd88ef9d5eb32a960291dffc 26-Apr-2017 George Mount <mount@google.com> Address API council feedback.

Bug 37636027

Change FragmentTransaction#setAllowOptimization() to
FragmentTransaction#setReorderingAllowed().

Test: I729dc05bde1f6eba6ff8d38eb15f65de777c14bb
Change-Id: I24c35aad95ffa14d2e2fa092ae71d3d459e6d648
/frameworks/base/core/java/android/app/Fragment.java
d3892caf95ce77c5e3c33a1f51d5ccbd7f313ccd 21-Apr-2017 Aurimas Liutikas <aurimas@google.com> Merge "Fix/suppress error-prone warnings in framework's fragment." into oc-dev
221f15d44ba24942a38db8f8dd37b491c2ae2a62 31-Mar-2017 Aurimas Liutikas <aurimas@google.com> Fix/suppress error-prone warnings in framework's fragment.

Bug: 37537860
Test: Compile
Change-Id: I0f30c423a712819ee78d16764acf20386360240f
/frameworks/base/core/java/android/app/Fragment.java
3fd812988f0fc47c71f4455d58b020d54fb9a906 18-Apr-2017 George Mount <mount@google.com> Adds getLayoutInflater() to return a cached value.

Bug 37156970

Many applications need to get the LayoutInflater used for
fragment View inflation. onGetLayoutInflater() can be heavy
weight, so a version that caches that last value is added.

Support Lib: I11d719d7416a5bb3b65f37a78e6ed96a69c32332
Test: I6aa0ecfe7136d133d15a597857f6cf6f3cf68fca

Change-Id: I686d5b39f7a046396fff124c33c22a73952ee5d7
/frameworks/base/core/java/android/app/Fragment.java
04fd470ce0166abb36d9be829d6e9b98a55eaf35 13-Apr-2017 Alan Viverette <alanv@google.com> Update more implementations of findViewById()

Bug: 24137209
Test: make checkbuild -j32
Change-Id: I104969fc74d6dc1d159e3d1ff5926640b124a540
/frameworks/base/core/java/android/app/Fragment.java
bb14fb9acb9d172a074a9efef7e9db8a76fe2589 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add hidden API startActivityForResultAsUser" into oc-dev
96d26fe3c55cdf88051698a2bf908b37b8b6a187 11-Apr-2017 Tony Mak <tonymak@google.com> Add hidden API startActivityForResultAsUser

Bug: 37197930

Test: runtest -x cts/tests/app/src/android/app/cts/FragmentReceiveResultTest.java
This verified existing startActivity* public APIs are still working
Test: The new hidden API is used/verified by the CLs under the same topic.

Change-Id: I2aca2823ecf26dc8a9318b3783b6041796c02582
/frameworks/base/core/java/android/app/Fragment.java
74af07647d7f00d9f40b77dc4067742d309b8cd6 05-Apr-2017 George Mount <mount@google.com> Call noteStateNotSaved on child fragment managers.

Bug 36740474

When onNewIntent() is called, it calls noteStateNotSaved on
the FragmentManager. It wasn't propagating that to child
FragmentManagers. This CL properly propagates the
noteStateNotSaved().

Test: I7cf360a4ed82ee34797896dc110477731c8206c0

Change-Id: Icfcbc385ef68657145b05cb59d5b2a70fe020992
/frameworks/base/core/java/android/app/Fragment.java
5af42fc3052ecaf35c937278a986143a65f6ce5f 25-Mar-2017 Winson Chung <winsonc@google.com> Ensuring multi-window callbacks contain new configuration and are in order

- This CL has two main changes:
1) It modifies the activity multi-window and picture-in-picture mode
changed callbacks to provide the configuration of the activity with
the mode applied.
2) It modifies the order in which the multi-window and picture-in-picture
mode callbacks are made, to ensure that when going in and out of
picture-in-picture: first PiP, then MW, and then the config change.
- Previously, the ordering of the two callbacks was inconsistent. When
calling moveActivityToPinnedStack(), we reparent the task into the pinned
stack (triggering the picture-in-picture mode change), followed by the
resize animation (causes configuration changes). Inversely, when we
expand the task to fullscreen (and not just remove it), we run the
animation first, which resizes the task to the final size (causes
configuration changes) then reparent after the animation completes
(triggering the picture-in-picture mode change).

In this CL, we ensure that for both the transition in and out of PiP, we
defer to the bounds animation to trigger the PiP mode change. Normal
calls to reparent or adding a new task are unchanged. When the PiP
mode change is called from the animation, it provides the final target
bounds which we use to calculate the target configuration of the activity
for the callback. If the bounds animation is interrupted, an update will
also be scheduled if we change the fullscreen state we are animating to.

To work around the issue where we are scheduling MW/PiP mode changes in
both the animation and the configuration change, we also now keep track
of each state internally in the ActivityRecord.

Bug: 36099777
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testConfigurationChangeOrderDuringTransition

Change-Id: I03513bc3a4d4a72c250983f22f079ce9d7a2cb40
Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/core/java/android/app/Fragment.java
c7146beabe21c84248c2c62336b0af8c2f19f4f5 29-Mar-2017 George Mount <mount@google.com> Make public getFragments() and onGetLayoutInflater() methods

Bug 34703669
Test: I846ef668e3dd7d664cfb56d2b9400467ba9b79f4
Change-Id: Ie202960ada86b25e964f98a639b5f5740c8fdb79
/frameworks/base/core/java/android/app/Fragment.java
79a973f643c7f9e54b698da0fcee8e6152a0d805 29-Mar-2017 Jeff Tinker <jtinker@google.com> Revert "Make public getFragments() and onGetLayoutInflater() methods"

This reverts commit 599be3d01ed1811ae365085e67a15d082170b583.

This change is being reverted because it broke git_master build.

Change-Id: I54ab9cd3d9e08dcf870f472fda08cc44e57986d0
bug: 34703669
/frameworks/base/core/java/android/app/Fragment.java
599be3d01ed1811ae365085e67a15d082170b583 22-Mar-2017 George Mount <mount@google.com> Make public getFragments() and onGetLayoutInflater() methods

Bug 34703669

Test: I71856306a7bb67aacb84be17165e7e095653c20a
Change-Id: I41999d0f5e6d75afebbbf67ad5bf49fa0cca509e
/frameworks/base/core/java/android/app/Fragment.java
550df700f1350f5adec57a691500eda3bbc2c2d6 23-Mar-2017 George Mount <mount@google.com> Fixed log warning for calling doStart() twice.

Bug 36504927

The LoaderManager was performing a doStart() multiple times
and issued a warning and then returned without any problems.
This CL fixes the underlying problem of doStart() being
called multiple times so that the warning isn't logged.

Test: ran fragment cts tests
Change-Id: I4a43280fd581e08ccd911d8d05367e00382d694a
/frameworks/base/core/java/android/app/Fragment.java
edae71777f94a419676ad669829b32bdbfad12fc 01-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix setting null target fragments"
0621742d3c9e691e4615da924db69333e371f3f7 01-Feb-2017 Adam Powell <adamp@google.com> Fix setting null target fragments

Bug 34869013
Test: CTS

Change-Id: Ibeed66f9a889a8e395bfabedcf22aebcbb848908
/frameworks/base/core/java/android/app/Fragment.java
adfd62c484f6d888cc9339e79619ccf72c3b133f 31-Jan-2017 Adam Powell <adamp@google.com> Fragment grab bag!

* Fragment#isStateSaved: report whether a given fragment has been
through state save within its given FragmentManager. This will
additionally echo the state of its child FragmentManager, indicating
whether it is safe to perform transactions without losing state.

* Fragment#setArguments can now be called at any time before a
fragment's state is saved, not just before an internal index is
assigned. This fixes an issue with assigning arguments during
fragment inflation in some code paths.

* FragmentTransaction#postOnCommit: Add a Runnable to a
FragmentTransaction that will be executed once the operations in the
transaction have been fully executed. Transaction optimization may
mean that other transaction ops could run before this is executed,
or that specific operations from this transaction were optimized
out. (e.g. a fragment in this transaction was added, but then
removed in a subsequent transaction before pending operations were
executed.) This may not be used for transactions added to the back
stack, as we cannot persist the runnable for later to guarantee
running it when the transaction is reversed.

Test: CTS
Change-Id: I4eb90588135e30f287c6487aa62ebda231f3dad3
/frameworks/base/core/java/android/app/Fragment.java
ab209a63a286ffb0ee57e884986839fa25d583ca 26-Jan-2017 Adam Powell <adamp@google.com> Lifecycle guarantees for target fragments

Ported from frameworks/support change id
I824eb312fbdfd6b548fe94aa2cd5b03afbaa97c7

When a target fragment was set using Fragment#setTargetFragment, all
bets were off, especially when restoring from instance state. Order of
lifecyle initialization was undefined meaning that two bugs could
occur, both of which manifested as the target fragment was not
initialized by the time the referring fragment's onCreate ran. One
could happen if the target fragment is on the back stack, the other
could happen if the target fragment was ordered unfortunately in
FragmentManager implementation details. (!)

Fix both by guaranteeing that any target fragment gets pushed forward
to at least the CREATED state before we dispatch any lifecycle events
for the referring fragment.

Add some sanity checks that try to keep developers from setting target
fragments across different FragmentManagers or from creating target
cycles, both of which are bad ideas.

Bug: 33653458
Test: CTS FragmentLifecycleTest
Change-Id: If624d4665d29e205d37b9b384322e64d6d6d3615
/frameworks/base/core/java/android/app/Fragment.java
0ce4b0e4c31a65864e0cda3c9d3fb6fe8a40f2ed 26-Jan-2017 Elliot Waite <elliotwaite@google.com> Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
54de77470de4f605eef7f4b4e01718b301fe275e 12-Jan-2017 Elliot Waite <elliotwaite@google.com> Fix @links in reference docs.

Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
/frameworks/base/core/java/android/app/Fragment.java
b2852cab467ef0c1181a1d5096c43c29fdf6a875 09-Jan-2017 Jason Monk <jmonk@google.com> Allow FragmentContainer to play a role in fragment construction

This allows class swapping, dependency injection, and other fun
stuff.

Test: manual
Change-Id: I93e17ccf9cebb6f542903d31597b5ea41544e069
/frameworks/base/core/java/android/app/Fragment.java
bb3aa34055be35676e6557210f894b1e0ead4e0a 16-Nov-2016 Adam Powell <adamp@google.com> Fix bugs around inflated child fragments
Framework edition

* Ensure that a fragment that has had its view destroyed has a chance
to recreate it.

* Clear mInLayout after views are destroyed

* Make sure that when a fragment is restored from the back stack and
reinflates its view that child fragments from fragment tags are
reconnected properly.

Bug: 32691935
Test: cts
Change-Id: I370d6db46e72fd8ac35f716e2130b9e10b93b1da
/frameworks/base/core/java/android/app/Fragment.java
4fe47117606d39e9b7ab5a7fbf5b0dce753c83ba 27-Oct-2016 George Mount <mount@google.com> Fix hide fragment transition

Bug 30699392

During optimized hide operations with fragment transitions, the
hidden fragment View should not be GONE, but instead be visible
and the exiting views should be made INVISIBLE. After the
transition completes, the fragment's view should be GONE.

Test: I189fb22883637888516fb04940dbb288cb9a49d2
Change-Id: I3a80fdaa198ed04916df02b1d2ca069e6992f88f
/frameworks/base/core/java/android/app/Fragment.java
86bfc666d33592f7db5584036aab8c44164d8dc2 13-Jul-2016 George Mount <mount@google.com> Add the ability to postpone transitions.

Bug 30502032
Bug 20068723

Fragments in a transaction can now indicate when they are ready
and the transaction should complete. Postponed transactions will
have new views in the fragments created and added to the hierarchy
INVISIBLE. When all postponed fragments are ready, the transitions
and animations will start. INVISIBLE views will be made VISIBLE
and removed views will be taken out of the View hierarchy

Test: Id72daf16a62658227ee21a1aaf18a9b7657b6ba1

Change-Id: Ie42034629fee73299f8f82f44506aabf89970c3f
/frameworks/base/core/java/android/app/Fragment.java
eca8e221db923927cdeca927c0b75807a7612145 07-Jul-2016 George Mount <mount@google.com> Optimize Fragment operations so that minimal work is done.

Bug 29631389

When multiple operations are executed at once, they sometimes
cancel each other. For example, if the following transactions
are queued:

Transaction 1: add A
Transaction 2: replace with B

This can be trimmed down to add B.

This CL optimizes fragments in both add and pop directions.

Developers can choose not to allow optimization by
using FragmentTransaction#setAllowOptimization

Test: If6637e9f1c2a414bebaff6404efc45dd828378ad

Change-Id: Iab75be3e0aa388fc79b794e647ac6893165bebd7
/frameworks/base/core/java/android/app/Fragment.java
0b70b195bdbcf26b898adb3221bf52b4f5843ee0 08-Sep-2016 Andrew Solovay <asolovay@google.com> docs: Fixing links to moved Fragments guide, + redirect am: f53968061c am: 1b1bef9fc8
am: 9d43d2bdf0

Change-Id: Icf2856969a4154810708bde0130315ef77be6d53
9d43d2bdf08867edcd605615f3483cc9ffb85bd6 08-Sep-2016 Andrew Solovay <asolovay@google.com> docs: Fixing links to moved Fragments guide, + redirect am: f53968061c
am: 1b1bef9fc8

Change-Id: Ida786f9316c31a6ca930398a4ac2f8a6c4a7d950
37b32a5d3167e4403890d5ea92ca65b79a4dd6a2 08-Sep-2016 Andrew Solovay <asolovay@google.com> docs: Fixing links to moved Fragments guide, + redirect
am: f53968061c

Change-Id: Ic29b29244d2919bcd5eb5b72daeaa8a78dc71e2d
f53968061cff4bb897748efe7c09bd7a203e1d8f 27-Aug-2016 Andrew Solovay <asolovay@google.com> docs: Fixing links to moved Fragments guide, + redirect

The Fragments API guide was moved, but apparently a redirect was
never set up. Also, there are a few links to the old location in
the Javadocs.

Staged the revised Javadocs (see first comment for stage location).
Not going to stage the redirects file since it would trash another,
bigger CL that deals with the redirects file, but it's pretty
straightforward.

bug: 30559011
Change-Id: Ibd65f85c1ebb9789c1d40614fe11fe4ffda97e58
/frameworks/base/core/java/android/app/Fragment.java
defc63c048a7ab9f7126920f8209861ae8b8e27e 10-Aug-2016 Dianne Hackborn <hackbod@google.com> A little more on issue #30766518: Document what targeting N does am: 5f1649e852 am: 6ffef759da
am: f83a8ffc20

Change-Id: Ia189a9c29812a1e2d09b1bddb65c7f537b0fe9bd
f49cfb874ee47217da02e5c07525a994d456d28e 10-Aug-2016 Dianne Hackborn <hackbod@google.com> Fix issue #30766518: Document what targeting N does am: b34cbedb4e am: 3a585b86be
am: 22fdbab5d0

Change-Id: Ic9beb458f4332b9ec72c4b4b4178a5bce1fcac82
5f1649e85293428850659e35a52d812416812704 10-Aug-2016 Dianne Hackborn <hackbod@google.com> A little more on issue #30766518: Document what targeting N does

Change-Id: I67f2bfd01261a4304b532495a0d3cc791726ed5e
/frameworks/base/core/java/android/app/Fragment.java
b34cbedb4e36f184232d7f40b093bdc9fd0cd752 09-Aug-2016 Dianne Hackborn <hackbod@google.com> Fix issue #30766518: Document what targeting N does

Also small documentation cleanup in a few other places.

Change-Id: I16581c751aa0ffa146faba3b140a8fa2170f4520
/frameworks/base/core/java/android/app/Fragment.java
7f46c1b73f421e461a8aed1d7629b00b1b178dbf 22-Jun-2016 Adam Powell <adamp@google.com> Clarify Fragment#setUserVisibleHint guarantees in docs

Note that setUserVisibleHint can be called from outside of the
fragment lifecycle. Some apps override it and expect otherwise,
and the bug fix for N will affect their expectations.

https://code.google.com/p/android/issues/detail?id=213681

Bug 29526496

Change-Id: I68d5690cefe5f354313f3d89e8ec5ebccaf2544f
/frameworks/base/core/java/android/app/Fragment.java
c59422a2c6db9cdd229820413a9af8ee66f5ec79 15-Jun-2016 Aurimas Liutikas <aurimas@google.com> Clarify Fragment construtor javadoc.

Bug:
https://code.google.com/p/android/issues/detail?id=170497
https://code.google.com/p/android/issues/detail?id=55991

Change-Id: If2309f441bb947f32da60ba7926cc6796e472fdf
/frameworks/base/core/java/android/app/Fragment.java
c3cfdaf6518bd4a2d012afdfe8915e9aebf8ddca 07-Jun-2016 Aurimas Liutikas <aurimas@google.com> Clarify Fragment#onHiddenChanged() documentation.

Prior comment said that fragment was hidden for both true and false
values of hidden.

Bug:
https://code.google.com/p/android/issues/detail?id=53178

Change-Id: I453ff52692157cffafef34d165c1436e845c217d
/frameworks/base/core/java/android/app/Fragment.java
e30299f99018f6d1094df53bb48efa712e7a9221 13-May-2016 Adam Powell <adamp@google.com> Add Fragment#onAttachFragment for parent fragments

Framework edition

Add a matching onAttachFragment method to Fragment to match the
fragment host version.

Bug 28760393

Change-Id: I5f50b3446449cae7110da6b4e468ee80f413e1e5
/frameworks/base/core/java/android/app/Fragment.java
467cc6f0e1703a961e76f763aef70185c6019405 11-May-2016 Adam Powell <adamp@google.com> Less lazy child FragmentManager creation

Framework edition

Fix a bug where child FragmentManagers moving too lazily into the
CREATED state and beyond caused child fragments to not be
attached/created when expected.

Bug 25019275

Change-Id: I04ff0d3bcb693178a6ee3057da591392defdbcf8
/frameworks/base/core/java/android/app/Fragment.java
a9bab98d7014aefc81adf3fcb689242b651d46f1 21-Apr-2016 Adam Powell <adamp@google.com> Move child FragmentManager shutdown for retained fragments

Some apps out there do some creative things in terms of calling their
own onDetach methods from elsewhere. Perform the child FragmentManager
shutdown for retained fragments in a package-level perform method
instead of in onDetach itself.

Also mark all existing fragment methods with @CallSuper.

Bug 28293847

Change-Id: I343b610f8d427fe5cabd523a78fbf0e6f3b34c57
/frameworks/base/core/java/android/app/Fragment.java
ef4d99f016077ba193fa00ba1b05dce8686f130c 18-Apr-2016 Adam Powell <adamp@google.com> Be bug-compatible with Fragment#setUserVisibleHint < N

Prior to Android N we were simply checking if a fragment had a
FragmentManager set before we would trigger a deferred
start. Unfortunately this also gets set before a fragment transaction
is committed, so if setUserVisibleHint was called before a transaction
commit, we would start the fragment way too
early. FragmentPagerAdapter triggers this situation.

Unfortunately some apps relied on this timing in overrides of
setUserVisibleHint on their own fragments, and expected, however
erroneously, that after a call to super.setUserVisibleHint their
onStart methods had been run.

Bug 28184671

Change-Id: Ie40d5f6963d312c2fad4a48fb4f992d33e65c83b
/frameworks/base/core/java/android/app/Fragment.java
a0c2dc3cf56bf9c90af517f4cd12ef80d375a85a 12-Apr-2016 Clara Bayarri <clarabayarri@google.com> Provide startIntentSenderForResult for fragments

Bug: 27700608
Change-Id: Ibb7689ba0527048dd5944c4315b986f16030081d
/frameworks/base/core/java/android/app/Fragment.java
3e10ae927cc4f655f4331264bd24da6b97d5ac1e 06-Apr-2016 Adam Powell <adamp@google.com> Fragment#setUserVisibleHint guard

Bug 28026606

Change-Id: I109bce6ecd35feaa045b61a7226b2a19344d2cda
/frameworks/base/core/java/android/app/Fragment.java
b963c99c3a1d896c45587c997e5293738c0a8a80 02-Apr-2016 Adam Powell <adamp@google.com> Don't performPendingDeferredStart on fragments that aren't added

Framework edition

When setting a user visibility hint on a fragment it was possible to
have a FragmentManager already set due to a transaction being composed
but before the commit, so only checking that we have one isn't
sufficient for determining whether we should perform a pending
deferred start. This could happen easily with ViewPager adapters. Use
isAdded() instead.

Also fix a bug where we could set our internal tracking of fragments
that need a deferred start incorrectly.

Bug 27814550

Change-Id: I3be65728650c48d27a3a9dd4ca15f52006d14ab9
/frameworks/base/core/java/android/app/Fragment.java
933076d80561751618f462b26309ce9e4c3ff3bf 30-Mar-2016 Andrii Kulian <akulian@google.com> Refactor usages of Picture In Picture and Multi Window (1/4)

Bug: 27365860
Change-Id: I1590e430a12ceb84cb83da295e0bf7e4378fea96
/frameworks/base/core/java/android/app/Fragment.java
eacacb5989a9ad178694dce8f59767fc9b71ea89 23-Mar-2016 Adam Powell <adamp@google.com> Fix bugs around restoring nested retained instance fragments

Framework edition

In a few configurations the child fragment state of a
retained-instance fragment would not be preserved correctly, leading
to child fragments not being restored. Clean this up along with live
state management issues that were leading to logged warnings during
normal fragment operation.

Bug 27371492
Bug 27477824

Change-Id: I847ac05b1757392580e008dc20c50c3ef365ca68
/frameworks/base/core/java/android/app/Fragment.java
f445f76ecafd9734e7f2ff9d5e42c3d77fdcfffd 01-Mar-2016 George Mount <mount@google.com> Merge "Clear child fragment manager after it is destroyed." into nyc-dev
0f3431b616e03fe76cb52cabad209f95e1d7899c 19-Feb-2016 Svetoslav Ganov <svetoslavganov@google.com> Merge "Improve requestPermissions API docs and throw correct exception." into nyc-dev
f66381cd0df0aad41b7e4db9994483e44e0aaada 19-Feb-2016 Svet Ganov <svetoslavganov@google.com> Improve requestPermissions API docs and throw correct exception.

bug:26220898

Change-Id: Iebda3fe13b963b10829de917fb00a9a14186b72c
/frameworks/base/core/java/android/app/Fragment.java
255b008afe262050a421e02ccb00068665ea7e4f 19-Feb-2016 Adam Powell <adamp@google.com> Fix NPE for Fragment#setUserVisibleHint(true)

Fix a bug where calling setUserVisibleHint(true) before adding a
Fragment to a FragmentManager could cause a crash.

Bug 27250018

Change-Id: Id192ae31bab95f15d32de9f105e707bdb8691641
/frameworks/base/core/java/android/app/Fragment.java
4c656b303351ec773906beaf9563d09b35bae43f 17-Feb-2016 George Mount <mount@google.com> Clear child fragment manager after it is destroyed.

Bug 26945643

After a child fragment manager has been destroyed, it should not
be reused because it is no longer attached to the host. Clearing
it ensures that it will be recreated when it is needed again when
the fragment has been reattached.

Change-Id: I7e52a42a66d761ab69596fdcdb5b2b2e3b4dcc6c
/frameworks/base/core/java/android/app/Fragment.java
44ba79e47d6db54e5501f994880fa09eb880c185 05-Feb-2016 Adam Powell <adamp@google.com> Permit setRetainInstance(true) on nested fragments, framework edition

Save arbitrarily nested fragments across config changes as
nonconfiguration objects. This permits the use of retain-instance
child fragments as arbitrary opaque dependencies within other
fragments.

Change-Id: Ia6640b76cfcf7ec28ba252628957a0c14863e957
(cherry picked from commit 7466be66263d5ebffb786ea402d9ed6e36c254f0)
/frameworks/base/core/java/android/app/Fragment.java
7c796811c040a3b9c189d49f138028c5e44466a4 30-Jan-2016 Wale Ogunwale <ogunwale@google.com> Added onMultiWindowChanged and onPictureInPictureChanged methods to Fragement class

Bug: 26688489
Change-Id: I611444b29199b4686c9f78dbdd33c9b71820aec4
/frameworks/base/core/java/android/app/Fragment.java
592df7d8c61c350033ee35062b12c7d66b9a7c8c 14-Jan-2016 Adam Powell <adamp@google.com> Init child fragments consistently with activity fragments

Fragments contained within an activity are restored from instance
state in FragmentActivity.onCreate, but fragments contained within
another fragment were previously restored from instance state in
performCreate after onCreate returned. This meant that developers
couldn't consistently rely on being able to control when this happens
with a call to super.onCreate, and calls to findFragmentByTag to
reconnect with a restored child fragment would fail in ways that
succeed when the fragment is directly added to an activity.

Change child fragment instance state restore to happen during
Fragment.onCreate instead of in performCreate to be consistent with
activity behavior. Preserve the old behavior for apps targeting
an SDK version < N.

Change-Id: I9c88d5554da9a32219d64c70ca638f75ecb233ed
/frameworks/base/core/java/android/app/Fragment.java
d1d4d9cb3a2f40aa1a476b9e55c7a4981da21c0f 12-Jan-2016 Adam Powell <adamp@google.com> Eagerly update fragment state when moving between states

As seen in frameworks/support!

Previously we would not set a fragment's new state until the move to a
new target state was fully complete. This causes problems when other
parts of the fragment manager infrastructure (such as lazily
initializing a child fragment manager) read that state while we're
dispatching a state change call to a fragment.

In this situation, adding a child fragment and then calling
executePendingTransactions on the child FragmentManager would not have
the intended effect, as the child FragmentManager would still be in
state INITIALIZING. The expected lifecycle callbacks to the child
fragment would then occur later.

Fix this by updating the fragment state as we go through each phase of
moveToState before we dispatch to the associated onState method,
matching our usual pattern of invoking onFoo methods after foo has
occurred. Delete the redundant resumed field as we now can use the
state directly.

Bug 25019275

Change-Id: I97fe45578d59ab643c9779eaeb475a331e446335
/frameworks/base/core/java/android/app/Fragment.java
b1444578d47f9db952815ec6845a1ea03ab2424e 04-Nov-2015 Felipe Leme <felipeal@google.com> Clarified usage of onDetach() and onCreate() when setRetainInstance() is set to true.
BUG: 25455734

Change-Id: I667629b76dcc39b0d2415cd368629720a77ed337
/frameworks/base/core/java/android/app/Fragment.java
04d6a65f51cadcf29cf1bb958bc1b300d6018f71 20-Oct-2015 Todd Kennedy <toddke@google.com> Merge "Retain fragment loaders" into mnc-dr-dev am: ad968cf4e5 am: 6320767fb1 am: 02940eb47f
am: 186fcb8b64

* commit '186fcb8b648edd31f7a59a358587264659e84f4f':
Retain fragment loaders
2ee19c7f46ab488f19380f4c70904a1ac00fee9a 20-Oct-2015 Todd Kennedy <toddke@google.com> Retain fragment loaders

Remove the partial fix [it did not work for child fragment managers]
and replace with a more general fix that works with all fragments.

Bug: 23838271
Change-Id: I88b465f6a06a6ad627b9651b9e2eea41fae08972
/frameworks/base/core/java/android/app/Fragment.java
e16fb554dd49db118327ece0d9aac8eb788c7c54 10-Sep-2015 Todd Kennedy <toddke@google.com> save "retain loader" state

We cannot pull the "retain loader" state from the Activity; an Activity may
not always be hosting a Fragment. Instead, save the "retain loader" state
inside the individual fragments.

Bug: 23838271
Change-Id: I8358183a7689b5a571ea7be03d769186b2812600
/frameworks/base/core/java/android/app/Fragment.java
6b79ad655e88d972ce2dad7b09d9d702421004f3 21-Sep-2015 Todd Kennedy <toddke@google.com> Merge "save "retain loader" state"
f8f2e334ac3ec95ef0155660c36648f5f679f883 21-Sep-2015 Todd Kennedy <toddke@google.com> Merge "Save Fragment's hidden state"
d7ad54e603cedcb5a927e92cd231d7e8549831ef 21-Aug-2015 Svet Ganov <svetoslavganov@google.com> Update requestPermission docs about requesting a held permission - framework

bug:23370436

Change-Id: I7c0134578f529ea698a2c237d19112d1d0a91828
/frameworks/base/core/java/android/app/Fragment.java
c5ac16f531504d5bde7c87f8e3088652daeb543f 10-Sep-2015 Todd Kennedy <toddke@google.com> save "retain loader" state

We cannot pull the "retain loader" state from the Activity; an Activity may
not always be hosting a Fragment. Instead, save the "retain loader" state
inside the individual fragments.

Bug: 23838271
Change-Id: I8358183a7689b5a571ea7be03d769186b2812600
/frameworks/base/core/java/android/app/Fragment.java
d6d1858c37e9814268bfd9107c715ae15770c2f2 23-Jul-2015 Todd Kennedy <toddke@google.com> Save Fragment's hidden state

Bug: 22666353
Change-Id: I4989e95d9ad3f78ab8bdf21d62808220e8beb1f1
/frameworks/base/core/java/android/app/Fragment.java
0f45c7c7c40f2863560988a24bc06f395e12244d 17-Jul-2015 Svet Ganov <svetoslavganov@google.com> Improve documentation of onRequestPermissionsResult

bug:22524902

Change-Id: Ic435171fa016d8841bea432c5c39d7b0a6a7b9e9
/frameworks/base/core/java/android/app/Fragment.java
9e136b88ba6a51ebb7c639dd186cc33b79a1b3d0 16-Jul-2015 Svet Ganov <svetoslavganov@google.com> Return a result from Fragment#shouldShowRequestPermissionRationale

bug:22523342

Change-Id: Ibacedec952316db705c57204fa448dbcada1c3e6
/frameworks/base/core/java/android/app/Fragment.java
255aece7def117c825b928f87da4cfd2d0975f0a 04-Jul-2015 Svet Ganov <svetoslavganov@google.com> Improve request permission docs

bug:22252258

Change-Id: Ife19eb6b1e17b43a824379d2a039ff1c441bebdd
/frameworks/base/core/java/android/app/Fragment.java
970b59cbe377e23e9c681a5cef30c01f730c7377 10-Jun-2015 Svetoslav <svetoslavganov@google.com> Use who when requesting permissions

Change-Id: Id0b231f8b74099b7877eb4441a1664416c641731
/frameworks/base/core/java/android/app/Fragment.java
a2011d232b96e24d97050c39515d14365f380378 04-Jun-2015 Svetoslav <svetoslavganov@google.com> Adding missing permission API to fragment

Change-Id: I90309a23a08a82f0ab93eb4f6185db09e035aac1
/frameworks/base/core/java/android/app/Fragment.java
434bd65ca61ff5cec46fce9fbe866d8ee40579da 04-May-2015 Todd Kennedy <toddke@google.com> Call Activity#onAttachFragment()

This was accidentally removed during the changes to abstract a Fragment host.
Also ensure Fragment#onInflate(Activity) gets invoked

Bug: 20825263
Change-Id: I981266ae1e8817db5c82ec4609bbcf4a5e676fee
/frameworks/base/core/java/android/app/Fragment.java
a5fc6f006f67867417b7a427de6e7394c4312dec 15-Apr-2015 Todd Kennedy <toddke@google.com> Remove dependency upon FragmentActivity

The FragmentManagerImpl is intimately tied with a FragmentActivity. In
many cases, we want to be able to create / manage Fragments outside of
a FragmentManager. This defines a FragmentController interface that can
be used by any class to host Fragments.

Bug: 19569654
Change-Id: I6816a5c1815122d206062b9f4584ad460b3d41dd
/frameworks/base/core/java/android/app/Fragment.java
c6d1c345f41cf817bf2c07c97b97107d94296064 26-Feb-2015 Svetoslav <svetoslavganov@google.com> Runtime permissions: per user permission tracking.

Before all permissions were granted at install time at once, so the user
was persented with an all or nothing choice. In the new runtime permissions
model all dangarous permissions (nomal are always granted and signature
one are granted if signatures match) are not granted at install time and
the app can request them as necessary at runtime.

Before, all granted permission to an app were identical for all users as
granting is performed at install time. However, the new runtime model
allows the same app running under two different users to have different
runtime permission grants. This change refactors the permissions book
keeping in the package manager to enable per user permission tracking.

The change also adds the app facing APIs for requesting runtime permissions.

Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
/frameworks/base/core/java/android/app/Fragment.java
3c32b620448673dd47f869e2029e12b72ee21ed1 23-Feb-2015 Scott Kennedy <skennedy@google.com> Add some more @Nullable annotations

Change-Id: I586d542e087eafa8355f0eaa606d66876c0f5a56
/frameworks/base/core/java/android/app/Fragment.java
7b9c912f536925ac6ec43935d6e97506851b33d6 31-May-2013 Tor Norbye <tnorbye@google.com> Add @ResourceInt annotations on APIs

Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
/frameworks/base/core/java/android/app/Fragment.java
c051955392840cb94bd6f0b2a8107a48d2ffc8b0 12-Feb-2015 Scott Kennedy <skennedy@google.com> Mark findViewById(int) @Nullable

Change-Id: I9bf7c08a896bd9c28400ff832179abc579fd502f
/frameworks/base/core/java/android/app/Fragment.java
75a6e82bcc625025c5f48dc6c33d0dd469e9ca61 10-Oct-2014 Dianne Hackborn <hackbod@google.com> am 36ae48a8: am d83e9e42: am 0761b1b5: am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev

* commit '36ae48a850bade17d485cb49dd40a3f11f667ad4':
Put in real "code" (aka marketing) name.
955d8d69ea6caabce1461dc25b339b9bf9dc61a6 08-Oct-2014 Dianne Hackborn <hackbod@google.com> Put in real "code" (aka marketing) name.

Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
/frameworks/base/core/java/android/app/Fragment.java
1a780826c2f24b5414c6e0e5b3d9fbc55c0be887 19-Sep-2014 George Mount <mount@google.com> am fbb670d9: am 5a988492: am 00877d68: am f187823e: Merge "Fix exception when fragment container has no View." into lmp-dev

* commit 'fbb670d9ddd16c174369cdd4575860dee6ffe8c4':
Fix exception when fragment container has no View.
0b26e4d58ab1a60340dd7ab35ca6e3bddff9f760 18-Sep-2014 George Mount <mount@google.com> Fix exception when fragment container has no View.

Bug 17535259

Change-Id: I29c9ef53dd693cbb4043ebfb4750753870c9e99a
/frameworks/base/core/java/android/app/Fragment.java
cb9ebc088afda1476fa365c665f7bac29bc5f2c9 13-Sep-2014 George Mount <mount@google.com> am 47dece77: am f607a73b: Merge "Changed method name to match Activity\'s method name." into lmp-dev

* commit '47dece7797c4fc6e19b42b605a5b9d45023a0bc9':
Changed method name to match Activity's method name.
85ea498d86b35ea9baf4e5ef96927bea17209636 12-Sep-2014 George Mount <mount@google.com> Changed method name to match Activity's method name.

Bug 17488968

Change-Id: I3f00561d96ff33e8eaf7234934c69e3b8e2681e8
/frameworks/base/core/java/android/app/Fragment.java
a9a1449dadcb281cf1e8f69cc2ffdc352ef2b8bf 10-Sep-2014 Jeff Davidson <jpd@google.com> am 426a5429: am cfd0e5c1: Merge "Update unclear Fragment Javadoc." into lmp-dev

* commit '426a54290911d4ccbec5e139f42d1b472ea42138':
Update unclear Fragment Javadoc.
2a129789adbfa64098cba50a27f88d9602d022ab 10-Sep-2014 Jeff Davidson <jpd@google.com> Update unclear Fragment Javadoc.

"Empty" could imply that the constructor body itself is empty, which
is not a requirement. All that matters is that the constructor is
public and takes no arguments.

Change-Id: Id1cda8835baee9f9ad89aba8b3d33b963e61e718
/frameworks/base/core/java/android/app/Fragment.java
4656e69bf36d42a35c9290ab79eeb33b4cca1d5c 08-Sep-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of 2008cff7 to lmp-dev-plus-aosp

Change-Id: I5148eda624e8504f12dbc1288cd4a7a5b7c10850
d0646dca40ff740bd49755ad60751678b0ccca52 28-Aug-2014 Mark Doliner <mark@kingant.net> Small documentation fixes across many files.

Change-Id: I3e8787ce4bc6018ea1dc9aef2a2cd4e0a8dde663
/frameworks/base/core/java/android/app/Fragment.java
6558056e8fccc32f9e1dc59e46d09f8d916b7538 29-Aug-2014 George Mount <mount@google.com> API Review: Change SharedElementListener to SharedElementCallback.

Bug 15863001
Bug 17289526

Changed SharedElementListener to SharedElementCallback
Renamed methods to use "on" prefix.
Adjusted javadoc to reflect usage in Fragments.

Change-Id: I7cc517c269a8e417cb5c3a0948bdd3b654d42472
/frameworks/base/core/java/android/app/Fragment.java
c03da0e7a9ef721709d51cf8a2d539a5bd8a320e 23-Aug-2014 George Mount <mount@google.com> Make Fragment Transitions match Acitivty Transitions API

Bug 17188255

Change-Id: I506a097be4010d7156caf465c95295c58612c16e
/frameworks/base/core/java/android/app/Fragment.java
371a809179c843d7ae661a10bc9b4b8cfcaff566 20-Jun-2014 Adam Powell <adamp@google.com> Inflate fragments from layout into child FragmentManagers

Previously, if an app inflated a layout in a Fragment's onCreateView
that itself had fragments included, those fragments would be added to
the Activity-level FragmentManager and would not share the same
lifecycle with the fragment it was inflated for. This led to some
nasty management headaches.

If an app targets L or above, add the fragment to the child
FragmentManager of the current fragment when inflated using the
LayoutInflater passed to the parent fragment.

Bug 12763389

Change-Id: Iad4ed7d5df602aea9579bf1503e206fa894630c1
/frameworks/base/core/java/android/app/Fragment.java
ce601aee4cf632e5fc9fd23265f293eada7b0d35 28-Feb-2014 Tim Kilbourn <tkilbourn@google.com> am 7489271c: am c405bae9: am 7071786e: Clear child FragmentManagers when destroying Fragments.

* commit '7489271cd12ef04ba19cd2ea31a1e79251b10a08':
Clear child FragmentManagers when destroying Fragments.
7071786e0074bea42b01236f817383cab69c1b63 28-Feb-2014 Tim Kilbourn <tkilbourn@google.com> Clear child FragmentManagers when destroying Fragments.

If Fragment has instantiated a child FragmentManager and is later
detached, it retains its reference to the child FragmentManager which
has been destroyed. This causes an IllegalStateException in the
child FragmentManager if the original Fragment is reattached.

Fixes Issue 42601.

Change-Id: I8db2b1a110a341dc259939723f4c5ec131ca5f1e
/frameworks/base/core/java/android/app/Fragment.java
d9273d6f289d9b55da3fd0db2f659fdfb48106a8 31-May-2013 Tor Norbye <tnorbye@google.com> Add typedefs and nullness annotations.

This changeset adds in typedef annotations (custom annotations
marked with @IntDef) for various int parameters and return values
in the API. It also adds nullness annotations for cases where the
documentation explicitly mentioned null policy, or where it was
blindingly obvious from the context. Also fixed some typos in the
documentation.

Change-Id: Ica27c01368895818e26237544edd8483007155bb
/frameworks/base/core/java/android/app/Fragment.java
1487466dc2ce14cccf0ff2bd2f824238aaa0044e 19-Jul-2013 Adam Powell <adamp@google.com> Add View#cancelPendingInputEvents API

This API allows an application to cancel deferred high-level input
events already in flight. It forms one tool of several to help apps
debounce input events and prevent things like multiple startActivity
calls, FragmentTransactions, etc. from executing when only one was
desired since it's otherwise not desirable for things like click
events to fire synchronously.

Change-Id: I60b12cd5350898065f0019d616e24d779eb8cff9
/frameworks/base/core/java/android/app/Fragment.java
364ed4dda42882b600dce48319881ff58464fced 26-Jul-2013 Amith Yamasani <yamasani@google.com> PreferenceActivity Fragment security

Provides a way for PreferenceActivities to verify that they
aren't being launched with Fragments not meant to be attached to
them. Default implementation will fail verification for apps built
with KLP. This will not affect apps built for earlier targets.

Also, make sure that the class being instantiated is a Fragment and
not some random class.

Bug: 9901133

Change-Id: I564cd5168eabcadd7594ea8011e2081ebebfe063
/frameworks/base/core/java/android/app/Fragment.java
3e82ba1a67b0c756ab6a289985f4cfc53725b311 16-Jul-2013 Dianne Hackborn <hackbod@google.com> Make ArrayMap public! :)

Also do some tweaking of the various container classes
to synchronize them with the support lib and make it
easier to copy code between the two.

And update activity/fragment to use ArrayMap.

Change-Id: I3cfe82392a17119dfc72c3d9961f64e1914f42be
/frameworks/base/core/java/android/app/Fragment.java
87bff974d01a51412846765ce327b5589f55b080 28-Feb-2013 Scott Main <smain@google.com> docs: clarify startActivity

Change-Id: I821321441bbb39b84031e9c65fe43762270e0148
/frameworks/base/core/java/android/app/Fragment.java
1b8ecc5031051b4bba620fac27552e84ca666496 09-Sep-2012 Dianne Hackborn <hackbod@google.com> A little cleanup.

Change-Id: Ie33fd1b02011606e67ce08df3cce887c07680c60
/frameworks/base/core/java/android/app/Fragment.java
62bea2f1710be0d1a42c07109fd4307ded660d3b 05-Sep-2012 Dianne Hackborn <hackbod@google.com> Nested fragments.

Change-Id: I79acc19b391352c16b06afee2ca543223c38e364
/frameworks/base/core/java/android/app/Fragment.java
ee76efb74b5886f98cdfebfbefe9b69224e016fb 05-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6584942 IllegalStateException: Failure saving state...

...active SuggestFragment{419494f0} has cleared index: -1

There were issues when the same fragment was removed and then
added again before completely finishing the remove (such as due
to a running animation).

Two fixes:

- Now when you call FragmentTransaction.replace() and are replacing
a fragment with the same fragment, this becomes a no-op, to avoid
visual artifacts in the transition and bad states.
- When we are moving the fragment state up and it is currently
animating away to the INITIALIZED state, we could end up making
the fragment inactive as part of the cleanup. In this case it
shouldn't be made inactive; we just need to initialize it but
keep it active since we are going to continue to use it.

Bug: 6584942
Change-Id: I8bfd73f2d8ef8f67b541b3e2525dfa5db6c3bfa5
/frameworks/base/core/java/android/app/Fragment.java
03fcc333cf0fbbc4df1215649746d6360801efd8 15-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6284404: ArrayIndexOutOfBoundsException in...

...FragmentManagerImpl.restoreAllState

This was a bug related to the difference between the pre- and post-HC
behavior of onSaveInstanceState(). Prior to HC, state was saved
before calling onPause(). Starting with HC, it is saved between
onPause() and onStop(). To maintain compatibility with existing
applications, there is a check in ActivityThread for pre-HC to in
that case emulate the behavior of old applications, still calling
onSaveInstanceState() before onPause() but using the state later.

One of the special cases we had to deal with in the old model of
saving state before pausing was restarting an activity that is
already paused.

Consider, for example: you have two activities on screen, the one on
top not fullscreen so you can see the one behind. The top activity
is resumed, the behind activity is paused. In the pre-HC world, the
behind activity would have already had its state saved.

Now you rotate the screen, and we need to restart the activities.
We need to destroy the behind activity and create a new instance,
but the new instance has to end up in the paused state. To
accompish this, we restart it with a flag saying that it should
end up paused. For the pre-HC world, since it ends up paused,
we need to make sure we still have its instance state kept around
in case we need it because we can't regenerate it (since it is
already paused).

So that is what the changed code here is doing. It goes through
the normal create/start/resume steps, but holds on to the current
saved state so that it isn't lost when resume clears it, and then
puts the activity back to paused and stuffs that old saved state
back in to it.

The problem is that this code was doing it for every application,
even HC apps. So we end up in a bad state, when a HC app has its
saved state sitting there as if it had been saved, even though it
is only paused. Now if we go to restart the activity again, instead
of asking it for a new saved state (as we should for a HC app as
part of stopping it), we just re-use the existing saved state again.

Now this wouldn't generally be a huge problem. Worst case, when we
restart the activity yet again we are just instantiating it from
the same saved state as we used last time, dropping whatever changes
may have happened in-between. Who cares? All it has been doing is
sitting there in the background, visible to the user, but not something
they can interact with. If the activity made changes to its
fragments, those changes will be lost, and we will restore it from
the older state.

However... if one of those fragements is a retained fragment, this
will *not* appear in the saved state, but actually be retained across
each activity instance. And now we have a problem: if the retained
fragments are changed during this time, the next activity instance
will be created from the most recent state for the retained fragments,
but the older state for everyting else. If these are inconsistent...
wham, dead app.

To fix this, just don't keep the saved state for HC apps.

Also includes a small optimization to ActivityStack to not push
the home screen to the front redundantly.

Change-Id: Ic3900b12940de25cdd7c5fb9a2a28fb1f4c6cd1a
/frameworks/base/core/java/android/app/Fragment.java
eb84cc6bbd6122287ead600c64ae251b9458de42 12-Apr-2012 Quddus Chong <quddusc@google.com> am c4180594: am 51cb7ca5: am c08787fc: Merge "SDK doc change: Fixed typo and added method parentheses in line 206. Bug: 6318971" into ics-mr1

* commit 'c4180594855bf108fe6eccf9f7ab57605ba86b58':
SDK doc change: Fixed typo and added method parentheses in line 206. Bug: 6318971
3790001c20494d1f355a67bec7751c4b8f07874f 11-Apr-2012 Quddus Chong <quddusc@google.com> SDK doc change: Fixed typo and added method parentheses in line 206.
Bug: 6318971

Change-Id: I57f3c7aff6209269ca0d95d616e551e2100eeb54
/frameworks/base/core/java/android/app/Fragment.java
7a2195cdd33f27c79eda343defc1f7ccf59cc8ac 20-Mar-2012 Dianne Hackborn <hackbod@google.com> Start using the new activity options argument.

New class lets you make an options bundle defining a custom animation,
as an alternative to Activity.overridePendingTransition().

Change-Id: I8e209bf52398a98ab9f1bcafa1ec0a580dae57c0
/frameworks/base/core/java/android/app/Fragment.java
a4972e951bf2bdb7afdafee95b3ab0c15b8bacae 14-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new "options" argument to all startActivity APIs.

This will be used to allow new features to be requested... such as,
say, a special kind of animation. Right now there are no options
defined.

Change-Id: I4eb6f27275cdd4bf186f6da316ab93a2372ad4b7
/frameworks/base/core/java/android/app/Fragment.java
e4ef9b1ac2c4d7a1deb25f575e341255369c5c3b 27-Feb-2012 felipeal <felipeal@google.com> DO NOT MERGE
(from master: Fixed minor typo on Javadoc)

Change-Id: I7d62e37011a7fd4d792fdfe5bd62022a850303a6
/frameworks/base/core/java/android/app/Fragment.java
1b4e4b657cd730046b51d3cabdf1525d89637a4c 27-Feb-2012 felipeal <felipeal@google.com> Fixed minor typo on Javadoc

Change-Id: I2040520030319c0330d659dfa06716be0bd41b7b
/frameworks/base/core/java/android/app/Fragment.java
7871badd5d4d29d80207e9cc09a0681f26a151d0 13-Dec-2011 Dianne Hackborn <hackbod@google.com> SDK only: now that support lib is in SDK, we can link to it.

Update some of the platform documentation to directly link to
relevent support lib docs. Yay!

Also improve BroadcastReceiver documentation to more clearly
discussion security around receivers, and how the support
lib's LocalBroadcastManager can help.

Change-Id: I563c7516d5fbf91ab884c86bc411aff726249e42
/frameworks/base/core/java/android/app/Fragment.java
78fed9b78f8b3b92979b94dda2640cdeaffb2573 07-Nov-2011 Adam Powell <adamp@google.com> Change the "start deferred" fragment API to "user visible hint"

Allow a fragment to set a hint of whether or not it is currently user
visible. This will be used implicitly to defer the start of fragments
that are not user visible until the loaders for visible fragments have
run. This hint defaults to true.

Change-Id: Id1349d319886a277ef07301f64f7b9e12c8729bf
/frameworks/base/core/java/android/app/Fragment.java
635c60af623c73d2409f5729c0953638b5d6c497 26-Oct-2011 Adam Powell <adamp@google.com> Add API for deferring fragment start.

Fragments now have the setDeferStart method to signal that a fragment
has lower priority than others. Deferred start fragments will not
always be started immediately; they will be started once any loaders
have finished servicing any outstanding requests. This is useful if
any attached fragments are not immediately visible and can wait to
start until later.

Disabling deferStart on a fragment that is waiting for a deferred
start will start it immediately. Start.

Change-Id: Ia1f004877ca5e88d4f10147d21c7e2e97f141c34
/frameworks/base/core/java/android/app/Fragment.java
b54e7a3d9f60ac605f404f9eb3c5e92ca51bbd23 04-Oct-2011 Joe Fernandez <joefernandez@google.com> docs: add developer guide cross-references, Project ACRE

Change-Id: I5df1c4e13af67ff4c4a5b22f3cb1247bf0103b09
/frameworks/base/core/java/android/app/Fragment.java
6c285977a0dc9605348bd9530282c7d006cbf8bd 30-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issues 5158104 and 4981556 (fragment problems)

5158104: com.android.contacts: java.lang.IllegalStateException:
Can not perform this action after onSaveInstanceState at
android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1201)

The ViewPager can just commit without worrying about a state loss,
since it can correctly reconstruct its state later.

4981556: Fragment.mImmediateActivity doesn't get restored on orientation change

I am giving up on this thing; I just don't see how it can actually
be correct. So now instead of getting an exception about a dup
add/remove at point of the add/remove call, this will happen later when
processing the transaction.

Also add an API for controlling the visibility of menus, which ViewPager
can use to have the correct menus shows. And add a method to get the
name of a back stack entry.

Change-Id: Idcba14cfa2a172545a7a2a2c466cb49ceb789619
/frameworks/base/core/java/android/app/Fragment.java
f0f5fffc6f578f531df7b208cfbfb53f884c0380 01-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5090996 - Crash on tapping Menu on dial pad

Let the FragmentManager handle deferring menu invalidation when
not currently resumed.

Change-Id: I6e5de9c8ab5288c7c90a59ce8e0c7bb9133b6eb5
/frameworks/base/core/java/android/app/Fragment.java
c68c913d357e2955d4bd7ca52829071e531c7825 29-Jul-2011 Dianne Hackborn <hackbod@google.com> Various work on out of memory managment.

- Improve how we handle processes that have shown UI, to take care
of more cases where we want to push them into the background LRU
list.
- New trim memory level for when an application that has done UI
is no longer visible to the user.
- Add APIs to get new trim memory callback.
- Add a host of new bind flags to tweak how the system will adjust
the OOM level of the target process.

Change-Id: I23ba354112f411a9f8773a67426b4dff85fa2439
/frameworks/base/core/java/android/app/Fragment.java
257466d4e24bd405204cb21a1663eb1cc99f6137 28-Jul-2011 Adam Powell <adamp@google.com> Merge "Bug 5076788 - Optimize the building and invalidation of menus"
89b09da7b3b1e69264d9ec710c66eb2f891b313e 27-Jul-2011 Adam Powell <adamp@google.com> Bug 5076788 - Optimize the building and invalidation of menus

Fix cases that weren't batching menu presenter changes correctly.

Have FragmentManager invalidate the options menu less often.

Change-Id: Ia66fcd09ada8b0a084ad6b08d4340a8fa0c8fc5d
/frameworks/base/core/java/android/app/Fragment.java
36193d09a87035395d036a730038b765ac0b0913 13-Jul-2011 Scott Main <smain@google.com> cherrypick Change-Id: I4713d3977a0a1514ff9c4217e7f3723c0346d0d8
docs: revise ActionBar class summary and add a few links to dev guide docs

Change-Id: I14df84b16d7bdab85aa74d8b8211e988b0519115
/frameworks/base/core/java/android/app/Fragment.java
15856f7b62d06d968f57441ffe7dd31aac631952 15-Jun-2011 Dianne Hackborn <hackbod@google.com> am 27bad6f3: am baa89d38: am f930232f: Fix a major problem in fragment lifecycle.

* commit '27bad6f33b98e8d7417a6ce4d7f09b2fa1146379':
Fix a major problem in fragment lifecycle.
f930232fd1c8d301d91853c8fe5dca43979ac807 15-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix a major problem in fragment lifecycle.

When animating away a fragment, we were not putting it through
the last part of its lifecycle (onDestroy() etc).

Also, retained fragments that have a target were broken. Oops.

Change-Id: I5a669b77a2f24b581cde2a0959acf62edb65e326
/frameworks/base/core/java/android/app/Fragment.java
542f2409d9be9211dcb8cdfe2f863c22ff6cf26f 15-Jun-2011 Ben Dodson <bjdodson@google.com> minor documentation fixes

Change-Id: I8ff5ad7c310fdbf0ade9d66e075d09e293182b89
/frameworks/base/core/java/android/app/Fragment.java
afc4b283fdaedec9bf32492a019b43cc33edc9b6 11-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix some problems with moving in and out of detached state.

Loaders were not being re-initialized correctly when coming back
(this would also impact the back stack). The ListView also wasn't
working correctly, and there were also problems with simply
re-using a Fragment instance after it had been removed.

Change-Id: I534b091ae09c0ef7ffffe9d68049e6840e8926b3
/frameworks/base/core/java/android/app/Fragment.java
b46ed7636be9341b6ce0b158b3d86f34a437e6da 03-Jun-2011 Dianne Hackborn <hackbod@google.com> Add new Fragment API for explicitly saving/restoring state.

Also fix issue #4519821:
Blank screen displayed on tapping "Battery Use" option in the settings

We weren't correctly doing the full Activity resume code when coming
back from delivering a new Intent or result.

And fix a fragment problem where we still weren't correctly restoring
the state of list views. (I think this was from a bad manual-merge
from master.)

Change-Id: If79dc7e998155c39ab8c04781f6c73a82238a9ef
/frameworks/base/core/java/android/app/Fragment.java
f9dd34f4d3203fd50363b3b0247c5d0db6fe2c8f 20-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE: Integrate from main - Deprecate a bunch of APIs.

And clean up some documentation.

Change-Id: I8f06e2fc3bb6c552581b64657e82ba690d524232
/frameworks/base/core/java/android/app/Fragment.java
16f6e89c2a4bbf73fe15cb2e81c8fec98c7ac831 16-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate fragment work from master

Back-port new fragment detach APIs from support lib.

This allow a much cleaner implementation of things like the
fragment pager class.

Integrate from support lib: fix restore of list state.

The FragmentManager/ListFragment impl was restoring the list
state before setting its adapter. This caused the list view to
lose the state, since it gets cleared as part of setting the
adapter. Now the fragment manager waits on restoring the view
hierarchy state until after it has done onActivityCreated(),
at which point we have set the adapter.

It would be nice to make list view less fragile in this regard,
but that is for a different change.

Change-Id: I38606ef7d0b06478995f3fb7726aead67420e172
/frameworks/base/core/java/android/app/Fragment.java
e3a7f628c6d9fef42be24999b3137ebe5c6f3525 04-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix Fragment.onInflate() to actually work correctly.

Like, um, it needs to be given the Activity since this is called before
the activity is attached.

And it was called after the entire fragment and its *view* was created
when being restored from saved state.

And the documentation was whacked.

Also fix the IME selector to dismiss when you tap outside of it.

Change-Id: Icbcafe7558965a570bdef9cda3441b1f0f7a317c
/frameworks/base/core/java/android/app/Fragment.java
7187ccb93ee8adbb745fcbb901cfacfeed397a23 25-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3385839: Fragment.onCreateView is passing in activity...

...context for a DialogFragment

Change-Id: I434ebca64d2738da4c27321db8dbbded2cbe167d
/frameworks/base/core/java/android/app/Fragment.java
5d9d03a0234faa3cffd11502f973057045cafe82 24-Jan-2011 Dianne Hackborn <hackbod@google.com> Maybe fix issue #3093599: java.lang.IndexOutOfBoundsException...

...Invalid index 0, size is 0 at
android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)

It looks like if an arrow key is dispatched between the time the
list view is told its data set has changed and it does the resulting
layout pass, we could try to move the position to a now invalid
index. This may prevent that from happening.

Also put in a better error message if saving state of a fragment
whose target is no longer in the fragment manager.

And fix a bug in PackageManager where we could return a null from
queryIntentActivities().

And add a new API to find out whether a fragment is being removed,
to help fix issue #3306021: NPE at
android.app.AlertDialog.getDefaultDialogTheme(AlertDialog.java)

Next, for new HC apps we can delay committing data to
storage until the activity is stopped.

Finally, use the new multi-threaded AyncTask executor in a few
places, so we don't have worked blocked by long-running tasks from
the application.

Change-Id: I27b2aafedf2e1bf3a2316309889613fa539760f3
/frameworks/base/core/java/android/app/Fragment.java
662cc7a46a44af782a1f697d16b0613498312e1f 18-Jan-2011 Scott Main <smain@google.com> add javadoc for getView method

Change-Id: Ia8d9516c4017319f8bcaedb3e4c451c5c3825857
/frameworks/base/core/java/android/app/Fragment.java
87121accdb0ce318482ac51270763a6faab2ed63 05-Jan-2011 Dianne Hackborn <hackbod@google.com> Some new API cleanup.

- Tweak Fragment docs to match new sample code.
- Make some new attributes public.
- Hide all of the XmlAdapter stuff, since it is not actually being used.

Change-Id: Iae2062f91d1ca0c6b1d656ae948417d3d048482f
/frameworks/base/core/java/android/app/Fragment.java
352cc98b4621b76959af8f8a698fd75c6d6132e8 04-Jan-2011 Dianne Hackborn <hackbod@google.com> Few little fragment, wm tweaks.

Deal with fragments being restored when their containing view is
gone.

Try to put in a black background during rotation. Currently commented
out because it appears to cause surface flinger to hang.

Change-Id: I150d061e64488356d17513f4e2d124d7c3d04f6b
/frameworks/base/core/java/android/app/Fragment.java
d173fa3b1cb8e4294aba7564c0171894be6c3c24 23-Dec-2010 Dianne Hackborn <hackbod@google.com> Possible fix to issue #3213749: NPE at...

...android.app.Fragment.startActivityForResult(Fragment.java)

Make sure to remove all pending messages when AbsListView is detached
from its window.

But... that's not enough.

It turns out that when a fragment's views are animating away, they of
course don't get detached until after the animation is done. However
the fragment itself is immediately destroyed, leaving its live views
still going after that.

Here's a possible solution: when fragment manager initiates an animation
on a fragment whose views are being removed, it makes note of that so
it can hold off on destroying the fragment until the animation is over.

There are a lot of interesting race conditions here, if further operations
happen on the fragment while it is being animated. I think the code here
does something sensible, and it does seem to work for the situations I
have tested, but it is hard to know all of the edge cases that may happen.

Change-Id: I4490ce8862a9bb714c7ea54baca3072c62126388
/frameworks/base/core/java/android/app/Fragment.java
a2ea747faaf5fcd437afbaaf4085cfc29e7c16b8 20-Dec-2010 Dianne Hackborn <hackbod@google.com> More cleanup of Loader APIs.

- Remove old method names.
- Introduce onXxx() hooks to Loader.
- Improve debugging.

Change-Id: I3fba072a05c7023aa7d2c3eb4e126feb514ab6d8
/frameworks/base/core/java/android/app/Fragment.java
d2835935d2df8be70d1b37d3ef3b2fe0155b3422 14-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3258849: Grab thumbnail when exiting an app via back

Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
/frameworks/base/core/java/android/app/Fragment.java
30d7189067524000c738c188c4ff91f84f474d25 11-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3274841: Orientation change problem with a paused activity

Plus a bunch of debug output improvements.

And some new Intent helpers for dealing with restarting an app.

Change-Id: I50ec56bca6a86c562156b13fe8a6fdf68038a12e
/frameworks/base/core/java/android/app/Fragment.java
bdd19bc338286e1042f59808545665a061e73ffc 11-Nov-2010 Dianne Hackborn <hackbod@google.com> Add Theme.Holo.DialogWhenLarge

This theme gives you a dialog look when running on a large
or xlarge screen, otherwise a regular full-screen activity.

Also some new Fragment convenience APIs.

Change-Id: I3d97928ffaa4f3bdfd0cc5daf8823f9235c4ba68
/frameworks/base/core/java/android/app/Fragment.java
8eb2e244f9b14d946ee587d0b673b866865026c0 01-Nov-2010 Dianne Hackborn <hackbod@google.com> Various PreferenceActivity and related improvement.

This is all about making the preferences implementation better.

Well, mostly all about that.

Change-Id: I8efa98cb5680f3ccfa3ed694a1586de3fb3a9e11
/frameworks/base/core/java/android/app/Fragment.java
5164246d7e47b9c995ca1e1587f3056eb777f60b 28-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix setting of class loader.

Also add Bundle API to retrieve its class loader because... well,
why not.

Change-Id: Ie939f6a2ae13974e5a05eb5bd3b28f350d8a8565
/frameworks/base/core/java/android/app/Fragment.java
fb3cffeb35368da22f99b85d45039c4e6e471c06 26-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3130426: Finsky crash in switching from window carousel

Need to note that we no longer have saved state before delivering
results or new intents to an activity.

Also do some work on loaders to prevent apps from making fragment
changes as a result of receiving loader data. This makes apps
consistent crash in a case that they would previously sometimes
crash (if they got the loader data after onPause).

Change-Id: I46e9e46d0aa05d9d7d6a275a2a488a18a20a5747
/frameworks/base/core/java/android/app/Fragment.java
625ac271f80777668f832a344486a6fcdc06d0ae 18-Sep-2010 Dianne Hackborn <hackbod@google.com> Work on fragments in layouts.

- Change semantics if IDs associated with these fragments, to
work correctly when placed in a container. If the container
has an ID or you have supplied a tag, the fragment's ID is
optional.

- To do this, there is a new LayoutInflater API that allows code
creating views to access the parent container that view will
be in.

- Fix issues with state management around these fragments. Now
correctly retains state when switching to a layout that doesn't
include the fragment.

Also:

- Add new simple list layouts for items that want to show an
activated state.
- Add new Activity.dump() that can be invoked with adb shell
dumpsys; the default implementation dumps fragment state.

Change-Id: I192f35e3ea8c53fbd26cf909095f2a994abfc1b6
/frameworks/base/core/java/android/app/Fragment.java
3e449ce00ed2d3b271e50bc7a52798f630973bf1 12-Sep-2010 Dianne Hackborn <hackbod@google.com> Some fragment stuff:

Fix issue #2975886: Make getTargetFragment() survive rotation events with
retained fragments. We now fix up the fragment pointer when restoring state.

Fix issue #2919928: In PreferenceFragment, addPreferencesFromResources() is
not effective when called after onActivityCreated(). Note to self: do not use
a what code of 0. Maybe that should be documented (I'll do it in gingerbread).

Hopefully implement #2992753: DialogFragment.dismiss will NPE if called too soon
(before attached to activity). We now keep track of the FragmentManager
separately from the activity, and set that as soon as the fragment is part of a
transaction.

Investigate issue #2988876: NPE when device orientation is changed. The NPE is
because of the app trying to do a fragment transaction in onPause(). This is
fundamentally not viable, since (a) the activity will be gone before we ever
have a chance to process the message to commit the transaction, and (b) even if
we did try to commit the transaction earlier, this would be done after
onSaveInstanceState() and thus not work in cases where the activity gets killed
in the background. So instead, we'll just throw an immediate exception if you
try to do this.

Change-Id: Iea62b50eb79f066af2471fce86836d073398f4f7
/frameworks/base/core/java/android/app/Fragment.java
2f761760459fe27c8e9f96569bb7f28fc5b58bab 13-Sep-2010 Daisuke Miyakawa <dmiyakawa@google.com> Fix typo.

onnSaveInstanceState -> onSaveInstanceState

Change-Id: I34981dd10fce4eaad6e1f6bba3d569e1e35e3c2a
/frameworks/base/core/java/android/app/Fragment.java
a18a86b43e40e3c15dcca0ae0148d641be9b25fe 07-Sep-2010 Chet Haase <chet@google.com> Rename several animation classes

Change-Id: I6a4544875090db485163c8d56de8718f56d267c7
/frameworks/base/core/java/android/app/Fragment.java
727782053ced0cac5beadc2c7ee9382d0f1ba1f5 21-Aug-2010 Dianne Hackborn <hackbod@google.com> Work on DialogFragment and docs.

- DialogFragment now has an option to not show a dialog, so you can
use your UI somewhere else.
- Deprecated show() versions that were tied to activities.
- Added documentation to DialogFragment class.
- Added documentation to onSaveInstanceState() to explain how the
time it is called is different than Activity's version.
- Fixed some java doc warnings.

Change-Id: If026744c368e2443030d2d9e0a9c808d820857df
/frameworks/base/core/java/android/app/Fragment.java
291905e34a7f0ae03c68fb2c1b8c34b92d447fbf 18-Aug-2010 Dianne Hackborn <hackbod@google.com> Maybe fix #2925641: calling onCreateOptionsMenu before attached activity

Also add some APIs to PreferenceActivity.

Change-Id: I85894a3eb9cd3e5adb78b82e85454c0d74773178
/frameworks/base/core/java/android/app/Fragment.java
3f00be5bd0b46e7937b68909baeff295b86215cc 16-Aug-2010 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: I9e887aacf3d3ba642df287dfdecbc2ff1ef02033
/frameworks/base/core/java/android/app/Fragment.java
def1537e9e8d0dd190cde5310ddae8b921088c9b 15-Aug-2010 Dianne Hackborn <hackbod@google.com> More fragment work:

- Introduce FragmentManager as a public API, deprecating the fragment
APIs on Activity. (They will be removed soon.)
- Add APIs to write a fragment reference to a bundle and later retrieve
it.
- Add Fragment API to set another fragment as its target, for delivering
results.
- Change when onInflate() is called and formalize its meaning in relation
to the fragment arguments that were previously introduced.
- Change onDestroyView() to always be called, regardless of when
onCreateView() returns. It now also is called slightly differently,
after the view hierarchy's state is saved.
- Fix some issues with DialogFragment's lifecycle with its associated
Dialog and state save/restore.
- Preference can now have a Bundle associated with it to provide
arguments to a fragment. The data for this Bundle call be supplied
via <extra> tags under a PreferenceScreen.
- PreferenceActivity's header XML tags are now <preference-headers>
and <header>, and you can supply <extra> tags under a <header> to set
arguments for the header's fragment.

Change-Id: I22c212c9fa862d50840201ca16e51f9de5ef0031
/frameworks/base/core/java/android/app/Fragment.java
b7a2e4772220c4b41df1260cedaf8912f4b07547 13-Aug-2010 Dianne Hackborn <hackbod@google.com> Fragment and PreferenceFragment and FragmentManager, oh my!

- Introduce FragmentManager public API, for all Fragment management
needs. Will in the future allow the removal of the (growing number
of) fragment APIs on Activity.

- Fragment now has a concept of arguments. This can be supplied
immediately after creation, and are retained across instances.

- PreferenceActivity now has an API to have it update its headers (note
not tested). Headers now have arguments. Keys for controlling
when PreferenceActivity shows at launch have been added to the SDK.

- Fixes to back stack handling and state saving/restoring.

Change-Id: Ib9d07ae2beb296c4eb3a4d9e1b3b59544675e819
/frameworks/base/core/java/android/app/Fragment.java
811ed1065f39469cf2cf6adba22cab397ed88d5e 06-Aug-2010 Chet Haase <chet@google.com> Make Fragments use the new animation APIs

Change-Id: I3e3c271234c737491b6ae37821f16434f4563b1d
/frameworks/base/core/java/android/app/Fragment.java
5e0d59547c4042037e23a42ba4e2521721e9c7d3 05-Aug-2010 Dianne Hackborn <hackbod@google.com> Fix some Loader bugs.

- Weren't re-attaching to the current loader manager after retaining
instance state.
- Ensure loaders are being destroyed.
- Fix a bug if you call restartLoader() inside of onLoadFinished().

Change-Id: I89df53db49d8e09047bf55216ebeb0f133c059e7
/frameworks/base/core/java/android/app/Fragment.java
b1ad5977bc8178b6d350ebe9099daded4c1ef603 03-Aug-2010 Dianne Hackborn <hackbod@google.com> New two-pane mode for PreferenceActivity.

This introduces a whole new way to use PreferenceActivity, as
a container for PreferenceFragments that the user can switch
between from a list of headers.

Change-Id: I1c79b7c78b86790dc460a1414a999aba5de80628
/frameworks/base/core/java/android/app/Fragment.java
4911b783aa9f4af5ac919db861751d350471f5ef 15-Jul-2010 Dianne Hackborn <hackbod@google.com> Fix bug where loader listener would be registered twice.

Also change LoaderManager to an interface.

Change-Id: Ife6d123e56cc6f63b6fe902afac35b2673761e60
/frameworks/base/core/java/android/app/Fragment.java
2707d6026240bcca6f0e35e2e1138958882e90ce 10-Jul-2010 Dianne Hackborn <hackbod@google.com> Implement instance passing in LoaderManager.

Activity now propagates loaders across instances when retaining
state. Adjusted APIs to make it better for apps to deal with this.

Change-Id: I8a6448cff1132e66207f9223eb29ccfc0decf2ca
/frameworks/base/core/java/android/app/Fragment.java
c801768e4d29667a2608695449ebc2833ba0f200 06-Jul-2010 Dianne Hackborn <hackbod@google.com> Integrate Loader support in to Activity/Fragment.

Introduces a new LoaderManager class that takes care of
most of what LoaderManagingFragment does. Every Fragment
and Activity can have one instance of this class. In the
future, the instance will be retained across config changes.

Also various other cleanups and improvement.

Change-Id: I3dfb406dca46bda7f5acb3c722efcbfb8d0aa9ba
/frameworks/base/core/java/android/app/Fragment.java
5ddd127d5a38d80c0d8087d1770f41f61f84f048 12-Jun-2010 Dianne Hackborn <hackbod@google.com> Implement ListFragment and Fragment context menus.

Also fix the docs build.

Change-Id: I96f24cc03e6debd897171e503957284b140a9f27
/frameworks/base/core/java/android/app/Fragment.java
4dc643eb6749afe5211198c920e739475590f92c 13-Jun-2010 Wink Saville <wink@google.com> Fix some javadoc link/see's to fix the build for the sdk-win_sdk target.

Change-Id: I243c19d3d7f1ed2decbd6bfc7ecbe6ce2b582fc2
/frameworks/base/core/java/android/app/Fragment.java
b31e84bc4513e46bac4be8f8d0513f78e360fb11 09-Jun-2010 Dianne Hackborn <hackbod@google.com> Add Fragment option menu APIs.

Also fix up how transactions are handled so that a series of transactions
can correctly be created and committed.

Change-Id: I948ba47d49e9b2246a1958bd9eac9dd36dc5a855
/frameworks/base/core/java/android/app/Fragment.java
cddfa6de1fcf1a9480d4c9b575102909bd8f2067 20-May-2010 Dianne Hackborn <hackbod@google.com> Fix sdk build.

Change-Id: I4106de6c85d69a68d80414db5dbf5cf48685ce54
/frameworks/base/core/java/android/app/Fragment.java
5ae74d6e89a30e79ea85c487b32223ef55314985 20-May-2010 Dianne Hackborn <hackbod@google.com> More fragment work.

Clean up FragmentTransaction API, add more animation control, add new
Fragment APIs for hiding and showing.

Change-Id: Iffe31351024a7a63d164270b8a955a499076600e
/frameworks/base/core/java/android/app/Fragment.java
6e8304e57ec533e257a2496183125f257be1ff60 14-May-2010 Dianne Hackborn <hackbod@google.com> More fragment stuff:

- New startActivityForResult() API.
- Fragments now should have the correct lifecycle while hanging around
in the back stack (not being destroyed and re-created).
- Rework of state save/restore to make it simpler and better. In theory
now any fragment (including layout and others in the hierarchy) can
now be retained across config changes, though this hasn't been tested.

Change-Id: I2a7fe560e14e567f5675a2f172a23fca67b3e97f
/frameworks/base/core/java/android/app/Fragment.java
b4bc78b16a05554c57508b488e21dd8eca4e13e6 13-May-2010 Dianne Hackborn <hackbod@google.com> Further work on fragments:

- Implement all of the state saving and restoring machinery. This
caused some flux in the API.
- Add ability to have fragments that are retained across activity
instances.
- Fix some bugs.

Change-Id: Ib6b5b0752d7f8d667cfdcd3e76d127cc9b6d901b
/frameworks/base/core/java/android/app/Fragment.java
f121be737c59390d97e21a92be8e166001534c7d 06-May-2010 Dianne Hackborn <hackbod@google.com> Improvements to fragment API:

- Remove names associated with fragments (we'll use ids). They may
come back for other uses.
- Add method to replace a fragment, to help in doing back stacks.
- Add names to back stack states, to allow for jumping back to
known states.
- Add ability to set animations associated with fragments being
added or removed.

Change-Id: Ic2799f06947b1511fb1df5965ca32568b860b3c3
/frameworks/base/core/java/android/app/Fragment.java
ba51c3d02d08709e933de6f6c76dee3fd2f4bfa1 06-May-2010 Dianne Hackborn <hackbod@google.com> New fragment stuff: back stack, and layout integration.

You can now have fragment transactions pushed on to a local back
stack, which will automatically be popped when the user pressed
back in the activity.

Fragments can also now be inserted into layouts.

Change-Id: Id1c9ae3fbc54f696cd8bb5ca5957bec4d3eabf18
/frameworks/base/core/java/android/app/Fragment.java
2dedce6e84679ead961a485c7fe4b0f77c713b6a 15-Apr-2010 Dianne Hackborn <hackbod@google.com> Introducing Fragment.

Basic implementation of an API for organizing a single activity into separate,
discrete pieces. Currently supports adding and removing fragments, and
performing basic lifecycle callbacks on them.

Change-Id: I6ea8e6bdb04d93f8105c2e983fe9b6532422de34
/frameworks/base/core/java/android/app/Fragment.java