Method to pop out the fragment. - Android User Interface

Android examples for User Interface:Fragment

Description

Method to pop out the fragment.

Demo Code


//package com.java2s;
import android.app.Activity;

import android.app.FragmentManager;

public class Main {
    /**/*from   w ww.  j a v a 2  s .  c  o  m*/
     * Method to pop out the fragment.
     *
     * @param activity Activity
     * @param tag      Tag of the fragment to be popped out
     * @return true if successfully popped else false
     */
    public static void popFragmentByTag(Activity activity, String tag) {
        FragmentManager fragmentManager = activity.getFragmentManager();
        fragmentManager.popBackStack();
    }
}

Related Tutorials