Merge "Add Fragment#onAttachFragment for parent fragments" into nyc-dev am: a6c0cc0992

am: 46ca7d8c28

* commit '46ca7d8c288da4414f40de7e8b1d8f929816bd82':
  Add Fragment#onAttachFragment for parent fragments

Change-Id: I6862300fc5aff480c4215d66eb8c9167ed17e448
This commit is contained in:
Adam Powell
2016-05-13 22:00:46 +00:00
committed by android-build-merger
5 changed files with 17 additions and 0 deletions

View File

@@ -4430,6 +4430,7 @@ package android.app {
method public void onActivityResult(int, int, android.content.Intent);
method public void onAttach(android.content.Context);
method public deprecated void onAttach(android.app.Activity);
method public void onAttachFragment(android.app.Fragment);
method public void onConfigurationChanged(android.content.res.Configuration);
method public boolean onContextItemSelected(android.view.MenuItem);
method public void onCreate(android.os.Bundle);

View File

@@ -4575,6 +4575,7 @@ package android.app {
method public void onActivityResult(int, int, android.content.Intent);
method public void onAttach(android.content.Context);
method public deprecated void onAttach(android.app.Activity);
method public void onAttachFragment(android.app.Fragment);
method public void onConfigurationChanged(android.content.res.Configuration);
method public boolean onContextItemSelected(android.view.MenuItem);
method public void onCreate(android.os.Bundle);

View File

@@ -4431,6 +4431,7 @@ package android.app {
method public void onActivityResult(int, int, android.content.Intent);
method public void onAttach(android.content.Context);
method public deprecated void onAttach(android.app.Activity);
method public void onAttachFragment(android.app.Fragment);
method public void onConfigurationChanged(android.content.res.Configuration);
method public boolean onContextItemSelected(android.view.MenuItem);
method public void onCreate(android.os.Bundle);

View File

@@ -1429,6 +1429,18 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
mCalled = true;
}
/**
* Called when a fragment is attached as a child of this fragment.
*
* <p>This is called after the attached fragment's <code>onAttach</code> and before
* the attached fragment's <code>onCreate</code> if the fragment has not yet had a previous
* call to <code>onCreate</code>.</p>
*
* @param childFragment child fragment being attached
*/
public void onAttachFragment(Fragment childFragment) {
}
/**
* Called when a fragment is first attached to its context.
* {@link #onCreate(Bundle)} will be called after this.

View File

@@ -941,6 +941,8 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
}
if (f.mParentFragment == null) {
mHost.onAttachFragment(f);
} else {
f.mParentFragment.onAttachFragment(f);
}
if (!f.mRetaining) {