use of org.aisen.weibo.sina.ui.activity.base.SinaCommonActivity in project AisenWeiBo by wangdan.
the class AisenUtils method setTabsText.
public static void setTabsText(Fragment fragment, int index, String text) {
if (fragment.getActivity() == null)
return;
ABaseFragment aFragment = null;
if (fragment.getActivity() instanceof SinaCommonActivity) {
aFragment = (ABaseFragment) fragment.getActivity().getFragmentManager().findFragmentByTag(SinaCommonActivity.FRAGMENT_TAG);
} else if (fragment.getActivity() instanceof MainActivity) {
aFragment = (ABaseFragment) fragment.getActivity().getFragmentManager().findFragmentByTag("MainFragment");
}
if (aFragment != null && aFragment instanceof ATabsTabLayoutFragment) {
ATabsTabLayoutFragment tabsFragment = (ATabsTabLayoutFragment) aFragment;
tabsFragment.getTablayout().getTabAt(index).setText(text);
}
}
Aggregations