FragmentTransaction.Commit Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Schedules a commit of this transaction.
[Android.Runtime.Register("commit", "()I", "GetCommitHandler")]
public abstract int Commit();
[<Android.Runtime.Register("commit", "()I", "GetCommitHandler")>]
abstract member Commit : unit -> int
Returns
The identifier of the committed transaction's back-stack entry when the transaction was added to the back stack; otherwise, a negative value.
- Attributes
Remarks
Schedules a commit of this transaction. The commit does not happen immediately; it will be scheduled as work on the main thread to be done the next time that thread is ready. A transaction can only be committed with this method prior to its containing activity saving its state. If the commit is attempted after that point, an exception will be thrown. This is because the state after the commit can be lost if the activity needs to be restored from its state. See commitAllowingStateLoss() for situations where it may be okay to lose the commit.
Android reference for android.app.FragmentTransaction.commit.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.