{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
interface FragmentOnAttachListener
Listener for receiving a callback immediately following Fragment#onAttach(Context)
. This can be used to perform any additional setup / provide any dependencies that the Fragment may need prior to child fragments being attached or the Fragment going through Fragment#onCreate(Bundle)
.
See also | |
---|---|
addFragmentOnAttachListener |
androidx.fragment.app.FragmentManager#addFragmentOnAttachListener(FragmentOnAttachListener) |
Public methods |
|
---|---|
abstract @NonNull void |
onAttachFragment( Called after the fragment has been attached to its host. |
@NonNull
public abstract void onAttachFragment(
@NonNull FragmentManager fragmentManager,
@NonNull Fragment fragment
)
Called after the fragment has been attached to its host. This is called immediately after Fragment#onAttach(Context)
and before Fragment#onAttach(Context)
has been called on any child fragments.
Parameters | |
---|---|
@NonNull FragmentManager fragmentManager |
FragmentManager the fragment is now attached to. This will be the same FragmentManager that is returned by |
@NonNull Fragment fragment |
Fragment that just received a callback to |