Example usage for android.app FragmentTransaction isAddToBackStackAllowed

List of usage examples for android.app FragmentTransaction isAddToBackStackAllowed

Introduction

In this page you can find the example usage for android.app FragmentTransaction isAddToBackStackAllowed.

Prototype

public abstract boolean isAddToBackStackAllowed();

Source Link

Document

Returns true if this FragmentTransaction is allowed to be added to the back stack.

Usage

From source file:com.silentcircle.silenttext.activity.AccountCreationActivity.java

@Override
public void onNext(Fragment fragment) {
    FragmentTransaction tx = getFragmentManager().beginTransaction();

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
        tx.setCustomAnimations(R.animator.slide_in_from_right, R.animator.slide_out_to_left,
                R.animator.slide_in_from_left, R.animator.slide_out_to_right);
    }/*from  ww w  . j  a va  2  s. com*/

    if (tx.isAddToBackStackAllowed()) {
        tx.addToBackStack(null);
    }
    tx.replace(R.id.content, fragment);
    tx.commit();
}