Android FragmentManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android FragmentManager class.

This code example shows how to use the following methods: beginTransaction, findFragmentByTag
     * @param tag 
     */ 
    protected static void show(DialogFragmentActivity activity,
            DialogFragmentHelper fragment, Bundle arguments, String tag) {
        FragmentManager manager = activity.getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        Fragment current = manager.findFragmentByTag(tag);
        if (current != null)
            transaction.remove(current);
        transaction.addToBackStack(null);
 
        fragment.setArguments(arguments);
        fragment.show(manager, tag);
    } 
 
    /** 
     * Create bundle with standard arguments 
     * 
     * @param title 
     * @param message 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: show, beginTransaction, findFragmentByTag
        return b.create();
    } 
 
    public static void show(FragmentActivity activity, int titleResId, int descriptionResId) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
        Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
        if (prev != null) {
            fragmentTransaction.remove(prev);
        } 
        fragmentTransaction.addToBackStack(null);
 
        SampleDescriptionDialogFragment.newInstance(titleResId, descriptionResId)
                .show(fragmentManager, FRAGMENT_TAG);
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: show, beginTransaction, findFragmentByTag
            return this;
        } 
 
        public void show() { 
            FragmentManager fragmentManager = mActivity.getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
            Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
            if (prev != null) {
                fragmentTransaction.remove(prev);
            } 
            fragmentTransaction.addToBackStack(null);
 
            ProgressDialogFragment.newInstance(mMessage, mOnCancelListener, mCancelable)
                    .show(fragmentManager, FRAGMENT_TAG);
        } 
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: show, beginTransaction, findFragmentByTag
            return this;
        } 
 
        public void show() { 
            FragmentManager fragmentManager = mActivity.getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
            Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
            if (prev != null) {
                fragmentTransaction.remove(prev);
            } 
            fragmentTransaction.addToBackStack(null);
 
            ErrorDialogFragment.newInstance(mTitle, mMessage, mOnClickListener, mOnCancelListener)
                    .show(fragmentManager, FRAGMENT_TAG);
        } 
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: show, beginTransaction, findFragmentByTag

Related Android FragmentManager Questions & Answers:

See Code Examples for Android FragmentManager Methods: