Ejemplo n.º 1
0
 public void a(TabHost.TabSpec paramTabSpec, Class<?> paramClass, Bundle paramBundle) {
   paramTabSpec.setContent(new agt(this.mContext));
   agu localagu = new agu(paramTabSpec.getTag(), paramClass, paramBundle);
   this.alL.add(localagu);
   this.Rk.addTab(paramTabSpec);
   notifyDataSetChanged();
 }
Ejemplo n.º 2
0
    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);
      mTabs.add(info);
      mTabHost.addTab(tabSpec);
      notifyDataSetChanged();
    }
 public void addTab(TabHost.TabSpec paramTabSpec, Class<?> paramClass, Bundle paramBundle)
 {
   paramTabSpec.setContent(new DummyTabFactory(this.mContext));
   String str = paramTabSpec.getTag();
   TabInfo localTabInfo = new TabInfo(str, paramClass, paramBundle);
   if (this.mAttached)
   {
     TabInfo.access$102(localTabInfo, this.mFragmentManager.findFragmentByTag(str));
     if ((localTabInfo.fragment != null) && (!localTabInfo.fragment.isDetached()))
     {
       FragmentTransaction localFragmentTransaction = this.mFragmentManager.beginTransaction();
       localFragmentTransaction.detach(localTabInfo.fragment);
       localFragmentTransaction.commit();
     }
   }
   this.mTabs.add(localTabInfo);
   addTab(paramTabSpec);
 }
Ejemplo n.º 4
0
  /**
   * Ajout d'une tab au conteneur
   *
   * @param activity activit� concern�e
   * @param tabHost Hote des Tabs
   * @param tabSpec nouvelle spec de la tab
   * @param tabInfo infos de la � cr�er
   */
  private static void addTab(
      DiffusionTabActivity activity, TabHost tabHost, TabHost.TabSpec tabSpec, TabInfo tabInfo) {

    // On Attache une factory � la spec de la tab
    tabSpec.setContent(activity.new TabFactory(activity));
    String tag = tabSpec.getTag();

    // On v�rifie si un fragment est d�j� li� � cette spec au quel cas
    // on le d�sactive afin de garantir l'�tat initial cach�
    tabInfo.fragment = activity.getSupportFragmentManager().findFragmentByTag(tag);
    if (tabInfo.fragment != null && !tabInfo.fragment.isDetached()) {
      FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
      ft.detach(tabInfo.fragment);
      ft.commit();
      activity.getSupportFragmentManager().executePendingTransactions();
    }
    tabHost.addTab(tabSpec);
  }
Ejemplo n.º 5
0
  public void addTab(final TabHost.TabSpec tabSpec, final Class<?> clss, final Bundle args) {
    tabSpec.setContent(new DummyTabFactory(mActivity));
    final String tag = tabSpec.getTag();

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

    // Check to see if we already have a fragment for this tab, probably
    // from a previously saved state. If so, deactivate it, because our
    // initial state is that a tab isn't shown.
    info.fragment = mActivity.getSupportFragmentManager().findFragmentByTag(tag);
    if (info.fragment != null && !info.fragment.isDetached()) {
      final FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
      ft.detach(info.fragment);
      ft.commit();
    }

    mTabs.put(tag, info);
    mTabHost.addTab(tabSpec);
  }
Ejemplo n.º 6
0
  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.commit();
      }
    }

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