Android Guides | Samples

Android.App.FragmentTransaction.Commit Method

Schedules a commit of this transaction.


[Android.Runtime.Register("commit", "()I", "GetCommitHandler")]
public abstract Int32 Commit ()


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 FragmentTransaction.CommitAllowingStateLoss for situations where it may be okay to lose the commit.

[Android Documentation]


Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 11