Example usage for android.support.v4.app FragmentManager POP_BACK_STACK_INCLUSIVE

List of usage examples for android.support.v4.app FragmentManager POP_BACK_STACK_INCLUSIVE

Introduction

In this page you can find the example usage for android.support.v4.app FragmentManager POP_BACK_STACK_INCLUSIVE.

Prototype

int POP_BACK_STACK_INCLUSIVE

To view the source code for android.support.v4.app FragmentManager POP_BACK_STACK_INCLUSIVE.

Click Source Link

Document

Flag for #popBackStack(String,int) and #popBackStack(int,int) : If set, and the name or ID of a back stack entry has been supplied, then all matching entries will be consumed until one that doesn't match is found or the bottom of the stack is reached.

Usage

From source file:org.alfresco.mobile.android.application.activity.PublicDispatcherActivity.java

@Subscribe
public void onAccountLoaded(LoadAccountCompletedEvent event) {
    // If the session is available, display the view associated
    // (repository, sites, downloads, favorites).
    if (event == null || event.account == null) {
        return;//ww w .j  a v a2s.c  om
    }
    if (requestedAccountId != -1 && requestedAccountId != event.account.getId()) {
        return;
    }
    requestedAccountId = -1;

    setSupportProgressBarIndeterminateVisibility(false);

    // Remove OAuthFragment if one
    if (getFragment(AccountOAuthFragment.TAG) != null) {
        getSupportFragmentManager().popBackStack(AccountOAuthFragment.TAG,
                FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }

    removeWaitingDialog();

    // Upload process : Display the view where the user wants to upload
    // files.
    if (getCurrentSession() == null) {
        return;
    }
    String type = null;
    Bundle b = null;
    switch (uploadFolder) {
    case R.string.menu_browse_sites:
        type = ConfigurationConstant.KEY_SITE_BROWSER;
        break;
    case R.string.menu_browse_root:
        type = ConfigurationConstant.KEY_REPOSITORY;
        break;
    case R.string.menu_favorites_folder:
        FavoritesFragment.with(this).setMode(FavoriteNodesRequest.MODE_FOLDERS).display();
        return;
    default:
        break;
    }

    if (type != null) {
        AlfrescoFragmentBuilder viewConfig = FragmentBuilderFactory.createViewConfig(this, type, null);
        if (viewConfig == null) {
            return;
        }
        viewConfig.display();
    }
}

From source file:com.waz.zclient.pages.main.profile.ZetaPreferencesActivity.java

@Override
public void onCloseCamera(CameraContext cameraContext) {
    getSupportFragmentManager().popBackStack(CameraFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

From source file:com.activiti.android.app.activity.MainActivity.java

public void switchAccount(ActivitiAccount acc) {
    // Analytics//from   ww w. ja  v  a  2s .  c om
    AnalyticsHelper.reportOperationEvent(this, AnalyticsManager.CATEGORY_SESSION,
            AnalyticsManager.ACTION_SWITCH, acc.getServerType(), 1, false);

    AccountsPreferences.setDefaultAccount(this, acc.getId());
    connect(acc.getId());
    getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    initSlideMenu();
    displayApplicationsMenu(true);
    loadDefaultFragment();
}

From source file:org.sufficientlysecure.keychain.ui.keyview.LinkedIdViewFragment.java

/** Switches between the 'verifying' ui bit and certificate status. This method
 * must behave correctly in all states, showing or hiding the appropriate views
 * and cancelling pending operations where necessary.
 *
 * This method also handles back button functionality in combination with
 * onBackStateChanged.//from  w  w w .j ava 2s.  c  o  m
 */
void setShowVerifying(boolean show) {
    if (!show) {
        if (mInProgress != null) {
            mInProgress.cancel(false);
            mInProgress = null;
        }
        getFragmentManager().removeOnBackStackChangedListener(this);
        new Handler().post(new Runnable() {
            @Override
            public void run() {
                getFragmentManager().popBackStack("verification", FragmentManager.POP_BACK_STACK_INCLUSIVE);
            }
        });

        if (!mVerificationState) {
            return;
        }
        mVerificationState = false;

        mViewHolder.showButton(0);
        mViewHolder.vKeySpinnerContainer.setVisibility(View.GONE);
        mViewHolder.showVerifyingContainer(mContext, false, mIsSecret);
        return;
    }

    if (mVerificationState) {
        return;
    }
    mVerificationState = true;

    FragmentManager manager = getFragmentManager();
    manager.beginTransaction().addToBackStack("verification").commit();
    manager.executePendingTransactions();
    manager.addOnBackStackChangedListener(this);
    mViewHolder.showVerifyingContainer(mContext, true, mIsSecret);

}

From source file:com.cyanogenmod.eleven.ui.activities.HomeActivity.java

/**
 * Immediately clears the backstack//  w  ww .j  av a  2s  .  co  m
 */
protected void clearBackStack() {
    final FragmentManager fragmentManager = getSupportFragmentManager();
    if (fragmentManager.getBackStackEntryCount() > 0) {
        final int id = fragmentManager.getBackStackEntryAt(0).getId();
        fragmentManager.popBackStackImmediate(id, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }
}

From source file:com.libreteam.taxi.Customer_Fragment_Activity.java

@Override
public void didPressLogOut() {
    /* changeable GPS setting by Ying */
    Taxi_System.changeGPS(getApplicationContext(), this);
    /**********************************/
    didHideMenu();//ww w.  ja  v a2s.  c om
    button.setVisibility(View.GONE);
    FragmentManager manager = getSupportFragmentManager();
    if (manager.getBackStackEntryCount() > 0) {
        FragmentManager.BackStackEntry first = manager.getBackStackEntryAt(0);
        manager.popBackStack(first.getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }
    Socket.socketDidDisconnect();
    Taxi_System.addSystem(context, "token", "");
    didAddFragment(new Customer_Login(), "code", new String[] {}, true);
}

From source file:com.sociablue.nanodegree_p1.MovieListFragment.java

@Override
public void onResume() {
    //If returning from detail view, remove detail view fragment
    if (getFragmentManager().findFragmentByTag("detail") != null) {
        getFragmentManager().popBackStack("transaction2", FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }/*from w  w w.  j  a va 2 s.c om*/
    super.onResume();
}

From source file:com.waz.zclient.pages.main.participants.ParticipantFragment.java

@Override
public void onCurrentConversationHasChanged(IConversation fromConversation, IConversation toConversation,
        ConversationChangeRequester conversationChangeRequester) {
    if (toConversation == null || toConversation instanceof InboxLinkConversation) {
        return;// w ww. j  a va2  s.  c  o  m
    }
    onConversationLoaded(toConversation);

    if (conversationChangeRequester == ConversationChangeRequester.START_CONVERSATION
            || conversationChangeRequester == ConversationChangeRequester.START_CONVERSATION_FOR_VIDEO_CALL
            || conversationChangeRequester == ConversationChangeRequester.START_CONVERSATION_FOR_CALL
            || conversationChangeRequester == ConversationChangeRequester.START_CONVERSATION_FOR_CAMERA) {
        getStoreFactory().getInAppNotificationStore().setUserLookingAtPeoplePicker(false);
        getChildFragmentManager().popBackStackImmediate(PickUserFragment.TAG,
                FragmentManager.POP_BACK_STACK_INCLUSIVE);
        getControllerFactory().getPickUserController()
                .hidePickUserWithoutAnimations(getCurrentPickerDestination());
    }

}

From source file:potboiler.client.PotsActivity.java

License:asdf

private void clearBackStake() {
    getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

From source file:com.hyperaware.conference.android.activity.MainActivity.java

private void showSection(final Section section) {
    // Showing a section creates a new "root" fragment; everything else is popped off
    final FragmentManager fm = getSupportFragmentManager();
    fm.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    fm.beginTransaction().replace(R.id.v_content, section.fragmentFactory.newFragment()).commit();

    appBarLayout.setExpanded(true, false);
    drawerLayout.closeDrawers();/*from   www .j av  a2  s .c o m*/
}