Public Final Boolean isadded ()
If the fragment object is added to its activity, it returns true, otherwise it returns false.
Public Final Boolean isdetached ()
If the fragment has been explicitly detached from the UI, then it returns true. In other words, use the Fragmenttransaction.detach (Fragment) method on the Fragment object.
This method is introduced in API level 13.
Public Final Boolean Ishidden ()
If the fragment object is already hidden, it returns true. By default, the fragment is displayed. can use the Onhiddenchanged (Boolean) callback method to get the state of the fragment object changes, it is important to note that the hidden state and other states are orthogonal---that is, to display the fragment object to the user, The fragment object must be started and not hidden.
Public Final Boolean isinlayout ()
If the layout is included in the activity hierarchy tree through the <fragment> tag, it returns TRUE. This method always returns True when fragment is created through the <fragment> tag. The old fragment object is restored from its previous state, except where the object is not displayed in the current state of the layout.
Public Final Boolean isremoving ()
Returns true if the current fragment object is being deleted from its activity. This removal process is not the end of the activity of the fragment object, but rather the process of removing the fragment object from the activity in which it resides.
Public Final Boolean isresumed ()
If the fragment object is in the recovery state, the method returns True. This method returns true during Onresume () and OnPause () callbacks.
Public Final Boolean isVisible ()
Returns true if the fragment object is visible to the user. This means it: 1. has been added to the activity; 2. Its view object is already bound to the window; 3. It is not hidden.
public void onactivitycreated (Bundle savedinstancestate)
This method is called when the activity of the fragment object is created and the view hierarchy tree of the fragment object is instantiated. This method can be used to do some final initialization processing, such as getting or recovering the state, and also for those fragment objects that use the Setretaininstance (Boolean) method to preserve their instances, because this callback method tells the fragment object, When it was associated with this new activity instance. The callback method is called after Oncreateview (Layoutinflater, ViewGroup, Bundle) and before OnStart ().
Parameters
Savedinstancestate If the fragment object is being rebuilt, the parameter specifies the state that was previously saved.
public void Onactivityresult (int requestcode, int resultcode, Intent data)
Receives the result from the previous call to the Startactivityforresult (Intent, int) method. A description of the onactivityresult (int, int, Intent) method is presented in the Activity API.
Parameters
Requestcode This integer is the initial request code provided by Startactivityforresult (), which allows you to identify the source of the result.
ResultCode This integer is the result code that is set and returned by the child activity through its Setresult () method.
Data is an object of type intent that returns the resulting data to the caller (the Extras attribute field that can bundle various data bindings to the intent object).
public void Onattach (activity activity)
This method is called when the fragment object is bound to its activity for the first time. After this method is called, the system invokes the Onccreate (Bundle) method of the Fragment object.
public void onconfigurationchanged (Configuration newconfig)
The system calls this method when the device configuration changes and the component is running. It is important to note that unlike activity, other components are not restarted when the configuration changes: they always handle this change by re-acquiring the resources.
After the feature is called, the updated resource object returns a resource value that matches the new configuration.
Parameters
newconfing Specifies the new device configuration.
public boolean oncontextitemselected (MenuItem Item)
This callback method is called when a menu item in the context menu is selected. The default implementation of the method is simply returning false (invoking the project's Runnable object or sending a message to the appropriate handler) for the normal processing that was released. You can use this method to do some other processing for the menu item.
Use the Getmenuinfo () method to get additional information that is set by the view object that is added to the menu item.
Its subclass application performs the default menu processing by calling the method implementation of the base class.
Parameters
Item This parameter specifies the context menu item that is selected.
return value
Returns False if normal context menu processing is allowed, otherwise true.
public void OnCreate (Bundle savedinstancestate)
This method is called by the system when the fragment object is initially created. The call time is before Onattach (Activity), Oncreateview (Layoutinflater, ViewGroup, Bundle).
It is important to note that this method can also be invoked in the process of its fragment activity, which is still being created. Therefore, you cannot rely on the context view hierarchy tree of the activity being initialized at this point in time.
Parameters
Savedinstancestate if the fragment is being rebuilt, this parameter specifies the state before the fragment.
Public Animator oncreateanimator (int Transit, boolean enter, int nextanim)
The system calls this method when an animation is loaded on the fragment object.
Android Class Reference---Fragment