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.fragments.node.update.EditPropertiesFragment.java

@Override
public void onNodeSelected(String fieldId, Map<String, Node> items) {
    formManager.setPropertyValue(fieldId, items);
    getActivity().getSupportFragmentManager().popBackStackImmediate(DocumentPickerFragment.TAG,
            FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

From source file:org.mariotaku.twidere.activity.support.DualPaneActivity.java

@Override
protected void onStart() {
    final FragmentManager fm = getSupportFragmentManager();
    if (!isDualPaneMode() && !FragmentManagerTrojan.isStateSaved(fm)) {
        // for (int i = 0, count = fm.getBackStackEntryCount(); i < count;
        // i++) {
        // fm.popBackStackImmediate();
        // }// w  w  w  . j a v  a  2 s . c  o m
        fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }
    super.onStart();
    final Resources res = getResources();
    final boolean is_large_screen = res.getBoolean(R.bool.is_large_screen);
    final boolean dual_pane_in_portrait = mPreferences.getBoolean(PREFERENCE_KEY_DUAL_PANE_IN_PORTRAIT,
            is_large_screen);
    final boolean dual_pane_in_landscape = mPreferences.getBoolean(PREFERENCE_KEY_DUAL_PANE_IN_LANDSCAPE,
            is_large_screen);
    final int orientation = res.getConfiguration().orientation;
    switch (orientation) {
    case Configuration.ORIENTATION_LANDSCAPE:
        if (mDualPaneInLandscape != dual_pane_in_landscape) {
            restart();
        }
        break;
    case Configuration.ORIENTATION_PORTRAIT:
        if (mDualPaneInPortrait != dual_pane_in_portrait) {
            restart();
        }
        break;
    }
}

From source file:com.waz.zclient.pages.main.conversation.ConversationManagerFragment.java

@Override
public boolean onBackPressed() {
    Fragment fragment = getChildFragmentManager()
            .findFragmentById(R.id.fl__conversation_manager__message_list_container);
    if (fragment instanceof OnBackPressedListener && ((OnBackPressedListener) fragment).onBackPressed()) {
        return true;
    }/*from  w  w  w.jav  a 2 s.  c  om*/

    if (fragment instanceof ParticipantFragment) {
        getControllerFactory().getConversationScreenController().hideParticipants(true, false);
        return true;
    }

    if (fragment instanceof PickUserFragment) {
        getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), true);
        return true;
    }

    if (fragment instanceof LikesListFragment) {
        getChildFragmentManager().popBackStack(LikesListFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        return true;
    }

    if (getControllerFactory().getConversationScreenController().isShowingParticipant()) {
        getControllerFactory().getConversationScreenController().hideParticipants(true, false);
        return true;
    }

    return false;
}

From source file:dev.ronlemire.samplestemplate.MainActivity.java

private void PopFragmentBackStack() {
    // http://stackoverflow.com/questions/5802141/is-this-the-right-way-to-clean-up-fragment-back-stack-when-leaving-a-deeply-nest
    fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

From source file:io.rapidpro.androidchannel.HomeActivity.java

private void showFragment(Fragment fragment, String tag, Bundle args, boolean clearBackStack) {
    FragmentManager manager = getSupportFragmentManager();
    FragmentTransaction ft = manager.beginTransaction();

    if (clearBackStack) {
        manager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    } else {/*  www. ja  v a2  s  . c  om*/
        ft.addToBackStack(null);
    }

    ft.setCustomAnimations(0, 0);

    if (args != null) {
        fragment.setArguments(args);
    }

    ft.replace(R.id.content_view, fragment, tag).commit();
}

From source file:dev.ronlemire.samplestemplate.MainActivity.java

 private void PopFragmentBackStack() {
   // http://stackoverflow.com/questions/5802141/is-this-the-right-way-to-clean-up-fragment-back-stack-when-leaving-a-deeply-nest
   fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}

From source file:com.waz.zclient.pages.main.conversationlist.ConversationListManagerFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_conversation_list_manager, container, false);

    mainContainer = ViewUtils.getView(view, R.id.fl__conversation_list_main);
    startuiLoadingIndicatorView = ViewUtils.getView(view, R.id.liv__conversations__loading_indicator);
    listLoadingIndicatorView = ViewUtils.getView(view, R.id.lbv__conversation_list__loading_indicator);

    startuiLoadingIndicatorView.setColor(getResources().getColor(R.color.people_picker__loading__color));
    listLoadingIndicatorView.setColor(getControllerFactory().getAccentColorController().getColor());

    confirmationMenu = ViewUtils.getView(view, R.id.cm__confirm_action_light);
    confirmationMenu.setVisibility(View.GONE);
    confirmationMenu.resetFullScreenPadding();
    optionsMenuControl = new OptionsMenuControl();

    if (savedInstanceState == null) {
        // When re-starting app to open into specific page, child fragments may exist despite savedInstanceState == null
        if (getControllerFactory().getPickUserController().isShowingUserProfile()) {
            getControllerFactory().getPickUserController().hideUserProfile();
        }//from w w  w . j  a v a  2s  .  com

        if (getControllerFactory().getPickUserController()
                .isShowingPickUser(IPickUserController.Destination.CONVERSATION_LIST)) {
            getControllerFactory().getPickUserController()
                    .hidePickUser(IPickUserController.Destination.CONVERSATION_LIST, false);

            Fragment pickUserFragment = getChildFragmentManager().findFragmentByTag(PickUserFragment.TAG);
            if (pickUserFragment != null) {
                getChildFragmentManager().popBackStack(PickUserFragment.TAG,
                        FragmentManager.POP_BACK_STACK_INCLUSIVE);
            }
        }

        getChildFragmentManager().beginTransaction()
                .add(R.id.fl__conversation_list_main,
                        ConversationListFragment.newInstance(ConversationListFragment.Mode.NORMAL),
                        ConversationListFragment.TAG)
                .add(R.id.fl__conversation_list__settings_box, OptionsMenuFragment.newInstance(true),
                        OptionsMenuFragment.TAG)
                .commit();
    }
    return view;
}

From source file:com.nekomeshi312.whiteboardcorrection.WhiteBoardCorrectionActivity.java

@Override
public void onBackPressed() {
    // TODO Auto-generated method stub
    if (mFragCameraView.isAdded()) {//CameraView?
        finish();/* w  w w.  ja  va 2  s  .  c om*/
    } else {
        boolean isResultFragAdded = mBoardResultFragment == null ? false : mBoardResultFragment.isAdded();
        getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        if (isResultFragAdded) {//Warp ????????WorpCheck?
            transitToBoardCheckFragment();
        } else {//??(WarpCheck?Back????????Capture????????
            if (!mWhiteBoardCheckInfo.mIsCaptured) {
                deleteCopyImg();
            }
            mWhiteBoardCheckInfo.resetInfo();
        }
    }
}

From source file:eu.e43.impeller.activity.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (m_drawerToggle.onOptionsItemSelected(item)) {
        return true;
    }//from w  ww  . ja  v a 2s  .  c om

    switch (item.getItemId()) {
    case android.R.id.home:
        FragmentManager fm = getSupportFragmentManager();
        fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        return true;

    case R.id.action_settings:
        startActivity(new Intent(this, SettingsActivity.class));
        return true;

    case R.id.action_about:
        startActivity(new Intent(this, AboutActivity.class));
        return true;

    default:
        return super.onOptionsItemSelected(item);
    }
}

From source file:com.LMO.capstone.KnoWITHerbalMain.java

public void selectItem(int position) {

    getSupportActionBar().setDisplayShowTitleEnabled(true);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    switch (position) {
    case 0://from w ww . jav  a2 s . c  o m
        //            this.title = navTitles[0];
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.replace(R.id.frame_content, new Camera()).commit();
        break;
    case 1:
        //            this.title = navTitles[1];
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.replace(R.id.frame_content, new PlantList()).commit();
        break;
    case 2:
        //            this.title = navTitles[2];
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.replace(R.id.frame_content, new TheApplication()).commit();
        break;
    case 3:
        //            this.title = navTitles[3];
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.replace(R.id.frame_content, new OpenSourceLicense()).commit();
        break;
    }

    this.title = navTitles[position];
    drawerLayout.closeDrawer(drawer);
}