Example usage for android.widget TabHost.TabSpec getTag

List of usage examples for android.widget TabHost.TabSpec getTag

Introduction

In this page you can find the example usage for android.widget TabHost.TabSpec getTag.

Prototype

@ViewDebug.ExportedProperty
public Object getTag() 

Source Link

Document

Returns this view's tag.

Usage

From source file:com.dh.superxz_bottom.fragment.FragmentTabHost.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            // ft.detach(info.fragment);
            ft.hide(info.fragment);//from  ww w .  j  a v  a  2  s.c om
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.keertech.myandroid.view.FragmentTabHost.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists.  This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            //ft.detach(info.fragment);
            ft.hide(info.fragment);//w w  w .  j a v  a2 s .  c om
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.suning.mobile.ebuy.lottery.utils.view.FragmentTabHostAllowLoseState.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.detach(info.fragment);/*from   w  ww. j  a v  a 2  s. co m*/
            ft.commitAllowingStateLoss();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.bslee.logtoolapk.widget.FragmentTabHost.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            //            ft.detach(info.fragment);
            ft.hide(info.fragment);//from  w  ww .j  a  v  a 2  s . c om
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.gome.haoyuangong.views.MyFragmentTabHost.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.detach(info.fragment);/* www. j  av a 2 s  .c o m*/
            //            ft.hide(info.fragment);//???
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:ru.zabbkit.android.ui.views.FixedFragmentTabHost.java

public final void addTab(final TabHost.TabSpec tabSpec, final Class<?> clss, final Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.detach(info.fragment);/*from w  w w  .  j  a v  a 2s . co m*/
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.seo.app.views.FragmentTabHost.java

@SuppressLint("NewApi")
public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            //            ft.detach(info.fragment);
            ft.hide(info.fragment);//from   w w w.j  a v  a 2 s . c  o  m
            ft.commitAllowingStateLoss();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.anlddev.customwidget.widget.AFragmentTabHost.java

public void addTab(@NonNull TabHost.TabSpec tabSpec, @NonNull Class<?> clss, @Nullable Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));

    final String tag = tabSpec.getTag();
    final TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists.  This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            final FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.detach(info.fragment);/*w  w  w.  j a v  a2s  .  c o  m*/
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.example.dj0708.androiddemo20151224.custom.CustomFragmentTabHost.java

public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mContext));
    String tag = tabSpec.getTag();

    TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if (info.fragment != null && !info.fragment.isDetached()) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            // ft.detach(info.fragment);
            ft.hide(info.fragment);// w  w w  .j  av  a 2s. c  o  m
            // ft.commit();
            ft.commitAllowingStateLoss();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}

From source file:com.sb.tododemo.widgets.SavedStateFragmentTabHost.java

public void addTab(final TabHost.TabSpec tabSpec, final Class<?> clss, final Bundle args) {

    tabSpec.setContent(new DummyTabFactory(mContext));
    final String tag = tabSpec.getTag();

    final TabInfo info = new TabInfo(tag, clss, args);

    if (mAttached) {
        // If we are already attached to the window, then check to make
        // sure this tab's fragment is inactive if it exists. This shouldn't
        // normally happen.
        info.fragment = mFragmentManager.findFragmentByTag(tag);
        if ((info.fragment != null) && !info.fragment.isDetached()) {
            final FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.detach(info.fragment);//from ww w.j  a va  2 s  .  c  o  m
            ft.commit();
        }
    }

    mTabs.add(info);
    addTab(tabSpec);
}