Example usage for android.support.v4.app FragmentTransaction commitAllowingStateLoss

List of usage examples for android.support.v4.app FragmentTransaction commitAllowingStateLoss

Introduction

In this page you can find the example usage for android.support.v4.app FragmentTransaction commitAllowingStateLoss.

Prototype

public abstract int commitAllowingStateLoss();

Source Link

Document

Like #commit but allows the commit to be executed after an activity's state is saved.

Usage

From source file:mc.xwidget.McDialog.java

public void fixedShow(FragmentActivity activity, String tag) {
    if (activity == null || activity.isFinishing()) {
        L.d(TAG, String.format("activity [%s] is null or is finishing!", activity));
        return;/*  w  ww  . j  a  v a2  s. c  o m*/
    }
    FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
    ft.add(this, tag);
    ft.commitAllowingStateLoss();
}

From source file:com.kotlin.alexwan.mvpkoltin.view.activity.BaseActivity.java

protected void addFragment(int containerId, Fragment fragment) {
    final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(containerId, fragment);
    transaction.commitAllowingStateLoss();
}

From source file:appocorrencias.com.appocorrencias.Activitys.DelayedProgressDialog.java

private void showDialogAfterDelay(FragmentManager fm, String tag) {
    startedShowing = true;//from   w w w.j av a  2  s  .c  o  m
    FragmentTransaction ft = fm.beginTransaction();
    ft.add(this, tag);
    ft.commitAllowingStateLoss();
}

From source file:com.mibaldi.loanmanagement.base.BaseActivity.java

protected void addFragment(int containerViewId, Fragment fragment) {
    FragmentTransaction fragmentTransaction = this.getSupportFragmentManager().beginTransaction();
    fragmentTransaction.replace(containerViewId, fragment);
    fragmentTransaction.commitAllowingStateLoss();
}

From source file:com.deange.textfaker.ui.dialog.PatchedDialogFragment.java

public int show(final FragmentTransaction transaction, final String tag, final boolean allowStateLoss) {
    try {/*from   w  w w .  j a va  2 s. c o m*/
        transaction.add(this, tag);
        return allowStateLoss ? transaction.commitAllowingStateLoss() : transaction.commit();

    } catch (final IllegalStateException e) {
        return 0;
    }
}

From source file:com.aujur.ebookreader.activity.CatalogActivity.java

private void hideDetailsView() {
    if (detailsFragment != null) {
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.hide(detailsFragment);//from   w w  w . j ava2  s .  c  o m
        ft.commitAllowingStateLoss();
    }
}

From source file:com.j1024.mcommon.support.GenericFragmentActivity.java

private void attachFragment(FragmentManager supportFragmentManager, Fragment fragment) {
    FragmentTransaction transaction = supportFragmentManager.beginTransaction();
    transaction.add(android.R.id.content, fragment);
    transaction.commitAllowingStateLoss();
}

From source file:com.brq.wallet.lt.activity.ViewTraderInfoActivity.java

@Override
protected void onResume() {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.replace(R.id.flTraderInfo, TraderInfoFragment.createInstance(_traderInfo));
    ft.commitAllowingStateLoss();
    super.onResume();
}

From source file:it.mb.whatshare.PatchedDialogFragment.java

@Override
public void show(FragmentManager manager, String tag) {
    FragmentTransaction transaction = manager.beginTransaction();
    transaction.add(this, tag);
    transaction.commitAllowingStateLoss();
}

From source file:com.techm.telestra.assignment.feed.FeedActivity.java

private void showFeedFragment() {
    if (mFeedFragment == null) {
        mFeedFragment = FeedFragment.getInstance(null);
    }//  w  w  w .  java  2s  .  c om
    if (!mFeedFragment.isVisible()) {

        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.container_activity_feed, mFeedFragment, FeedFragment.TAG);
        fragmentTransaction.commitAllowingStateLoss();
    }
}