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:com.tatteam.patente.ui.fragment.CorreggiFragment.java

@Override
public boolean onBackPressed() {
    getFragmentManager().popBackStack(DoExamsFragment.TRANSCATION_NAME,
            FragmentManager.POP_BACK_STACK_INCLUSIVE);
    return true;//from ww  w .j  av  a2  s .com
}

From source file:org.alfresco.mobile.android.application.fragments.profile.ProfilesConfigFragment.java

@Override
public void onListItemClick(GridView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    ProfileConfig profile = (ProfileConfig) l.getItemAtPosition(position);
    ConfigManager.getInstance(getActivity()).swapProfile(getAccount(), profile.getIdentifier());
    getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);

    // Analytics/*ww w.j  av  a2 s. c  o m*/
    AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SESSION,
            AnalyticsManager.ACTION_SWITCH, AnalyticsManager.LABEL_PROFILE, 1, false);
}

From source file:org.mozilla.gecko.tabs.TabHistoryFragment.java

public void dismiss() {
    if (dismissed) {
        return;//from  w w  w. j a v  a  2 s  . co m
    }

    dismissed = true;

    if (backStackId >= 0) {
        getFragmentManager().popBackStackImmediate(backStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        backStackId = -1;
    }

    if (parent != null) {
        parent.setVisibility(View.GONE);
    }
}

From source file:com.popdeem.sdk.uikit.fragment.PDUITagFriendsFragment.java

@Nullable
@Override/* w  w w  .j av  a2s.  co m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_pd_tag_friends, container, false);

    mTaggedNames = getArguments().getStringArrayList("names");
    mTaggedIds = getArguments().getStringArrayList("ids");

    mProgress = (ProgressBar) view.findViewById(R.id.pd_progress_bar);
    mTaggedFriendsTextView = (TextView) view.findViewById(R.id.pd_tagged_friends_text_view);

    view.findViewById(R.id.pd_tagged_friends_text_view).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mConfirmCallback.taggedFriendsUpdated(mTaggedNames, mTaggedIds);
            getActivity().getSupportFragmentManager().popBackStack(PDUITagFriendsFragment.class.getSimpleName(),
                    FragmentManager.POP_BACK_STACK_INCLUSIVE);
        }
    });

    final EditText searchEditText = (EditText) view.findViewById(R.id.pd_tag_friends_search_edit_text);
    searchEditText.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            mAdapter.getFilter().filter(s);
        }

        @Override
        public void afterTextChanged(Editable s) {

        }
    });
    searchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_UNSPECIFIED) {
                PDUIUtils.hideKeyboard(getActivity(), searchEditText);
                return true;
            }
            return false;
        }
    });

    mAdapter = new PDUITaggableFriendsListViewAdapter(getActivity(), R.layout.item_pd_taggable_friend, friends);
    mAdapter.setCallback(mFriendsCheckBoxChangedCallback);

    ListView listView = (ListView) view.findViewById(R.id.pd_tag_friends_list_view);
    listView.setAdapter(mAdapter);

    updateTaggedFriendsButton();
    makeTaggableFriendsRequest();

    return view;
}

From source file:com.koushikdutta.widgets.ListContentFragmentInternal.java

@SuppressLint("InlinedApi")
void setContentNative(final String breadcrumb) {
    android.app.Fragment f = (android.app.Fragment) mCurrentContent;
    Activity fa = getActivity();// w  w  w  .  ja v a2 s.  com
    final android.app.FragmentManager fm = fa.getFragmentManager();

    android.app.FragmentTransaction ft = fm.beginTransaction();
    if (isPaged()) {
        if (listener == null) {
            fm.addOnBackStackChangedListener(new android.app.FragmentManager.OnBackStackChangedListener() {
                {
                    listener = this;
                }

                @Override
                public void onBackStackChanged() {
                    android.app.Fragment f = (android.app.Fragment) getFragment();
                    if (f.isDetached() || f.isRemoving()) {
                        fm.removeOnBackStackChangedListener(this);
                        return;
                    }
                    View v = getFragment().getView();
                    if (v == null)
                        return;
                    final View l = v.findViewById(R.id.list_fragment);
                    if (l == null)
                        return;
                    if (fm.getBackStackEntryCount() > 0 && "content"
                            .equals(fm.getBackStackEntryAt(fm.getBackStackEntryCount() - 1).getName())) {
                        l.setVisibility(View.GONE);
                    } else {
                        l.setVisibility(View.VISIBLE);
                    }
                }
            });
        }

        fm.popBackStack("content", android.app.FragmentManager.POP_BACK_STACK_INCLUSIVE);
        ft.setBreadCrumbTitle(breadcrumb);
        ft.setBreadCrumbShortTitle(breadcrumb);
        ft.addToBackStack("content");
    }
    ft.replace(getContentId(), f, "content");
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.commit();
}

From source file:com.twolinessoftware.activities.BaseActivity.java

public void clearBackStack() {
    int backStackCount = getSupportFragmentManager().getBackStackEntryCount();
    for (int i = 0; i < backStackCount; i++) {
        int backStackId = getSupportFragmentManager().getBackStackEntryAt(i).getId();
        getSupportFragmentManager().popBackStack(backStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }//w ww .  j ava  2  s .co  m
}

From source file:org.alfresco.mobile.android.application.widgets.BaseShortcutActivity.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;/*w  w w .  j  av a 2  s.  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 && rootFolderTypeId == R.string.menu_browse_sites) {
        BrowserSitesPagerFragment.with(this).display();
    } else if (getCurrentSession() != null && rootFolderTypeId == R.string.menu_browse_root) {
        DocumentFolderBrowserFragment.with(this).folder(getCurrentSession().getRootFolder()).display();
    } else if (getCurrentSession() != null && rootFolderTypeId == R.string.menu_favorites_folder) {
        FavoritesFragment.with(this).setMode(FavoriteNodesRequest.MODE_FOLDERS).display();
    }
}

From source file:org.chromium.latency.walt.MainActivity.java

@Override
protected void onResume() {
    super.onResume();

    final UsbDevice usbDevice;
    Intent intent = getIntent();/* w ww  .j  a v a  2 s  .c om*/
    if (intent != null && intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) {
        setIntent(null); // done with the intent
        usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
    } else {
        usbDevice = null;
    }

    // Connect and sync clocks, but a bit later as it takes time
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            if (usbDevice == null) {
                waltDevice.connect();
            } else {
                waltDevice.connect(usbDevice);
            }
        }
    }, 1000);

    if (intent != null && AutoRunFragment.TEST_ACTION.equals(intent.getAction())) {
        getSupportFragmentManager().popBackStack("Automated Test", FragmentManager.POP_BACK_STACK_INCLUSIVE);
        Fragment autoRunFragment = new AutoRunFragment();
        autoRunFragment.setArguments(intent.getExtras());
        switchScreen(autoRunFragment, "Automated Test");
    }
}

From source file:com.mifos.mifosxdroid.core.MifosBaseActivity.java

public void clearFragmentBackStack() {
    FragmentManager fm = getSupportFragmentManager();
    int backStackCount = getSupportFragmentManager().getBackStackEntryCount();
    for (int i = 0; i < backStackCount; i++) {
        int backStackId = getSupportFragmentManager().getBackStackEntryAt(i).getId();
        fm.popBackStack(backStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }//ww  w .j  av  a 2s  . c o  m
}

From source file:com.activiti.android.app.fragments.app.AppInstancesFragment.java

@Override
public void onListItemClick(GridView l, View v, int position, long id) {
    Cursor cursor = (Cursor) l.getItemAtPosition(position);
    adapter.notifyDataSetChanged();/*from www.  j a  va  2  s.co  m*/

    RuntimeAppInstance item = RuntimeAppInstanceManager.getInstance(getActivity()).getByProviderId(id);
    boolean back = true;
    if (drawerId != null) {
        // Analytics
        AnalyticsHelper.reportOperationEvent(getActivity(), AnalyticsManager.CATEGORY_SESSION,
                AnalyticsManager.ACTION_SWITCH, AnalyticsManager.LABEL_APPS, 1, false);

        ((AppInstanceCursorAdapter) l.getAdapter()).setSelected(item.getId());
        ((AppInstanceCursorAdapter) l.getAdapter()).notifyDataSetInvalidated();

        // Flag last used Application
        InternalAppPreferences.savePref(getActivity(), getAccount().getId(),
                InternalAppPreferences.PREF_LAST_APP_USED, item.getId());
        InternalAppPreferences.savePref(getActivity(), getAccount().getId(),
                InternalAppPreferences.PREF_LAST_APP_NAME, item.getName());

        // Clean Right Menu.
        resetRightMenu();

        ((MainActivity) getActivity()).hideSlideMenu();
        back = false;
        getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }

    TasksFragment.with((MainActivity) v.getContext()).appName(item.getName()).appId(item.getId()).back(back)
            .display();
}