hide Fragments - Android User Interface

Android examples for User Interface:Fragment

Description

hide Fragments

Demo Code


//package com.java2s;

import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;

public class Main {
    private static void hideFragments(String[] hideTags,
            FragmentManager fm, FragmentTransaction ft) {
        for (String t : hideTags) {
            Fragment f = fm.findFragmentByTag(t);
            if (f != null) {
                ft.hide(f);//from   w  w w .  java 2 s  . c  o  m
            }
        }
    }
}

Related Tutorials