Merge "Add Fragment#onAttachFragment for parent fragments" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a6c0cc0992
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user