本文整理汇总了Java中android.support.v4.app.FragmentManager.BackStackEntry.getName方法的典型用法代码示例。如果您正苦于以下问题:Java BackStackEntry.getName方法的具体用法?Java BackStackEntry.getName怎么用?Java BackStackEntry.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.FragmentManager.BackStackEntry
的用法示例。
在下文中一共展示了BackStackEntry.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCurrentFragment
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
public Fragment getCurrentFragment()
{
final int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
if (backStackEntryCount > 0)
{
try
{
final BackStackEntry backStackEntryAt = getSupportFragmentManager().getBackStackEntryAt(backStackEntryCount - 1);
String fragmentTag = backStackEntryAt.getName();
Fragment currentFragment = getSupportFragmentManager().findFragmentByTag(fragmentTag);
return currentFragment;
}
catch (Exception e)
{
// fix possible race condition:
// when called in background thread - back stack could be different between call of
// getBackStackEntryCount() and getBackStackEntryAt()
e.printStackTrace();
}
}
return getSupportFragmentManager().findFragmentByTag(AppConstants.PAGE_TITLE_MAIN);
}
示例2: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void onBackStackChanged() {
int count = mFragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = mFragmentManager
.getBackStackEntryAt(count - 1);
mPath = fragment.getName();
} else {
mPath = EXTERNAL_BASE_PATH;
}
setTitle(mPath);
if (HAS_ACTIONBAR)
invalidateOptionsMenu();
}
示例3: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
@Override
public void onBackStackChanged() {
int count = mFragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = mFragmentManager.getBackStackEntryAt(count - 1);
mPath = fragment.getName();
} else {
mPath = EXTERNAL_BASE_PATH;
}
setTitle(mPath);
if (HAS_ACTIONBAR)
invalidateOptionsMenu();
}
示例4: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
public void onBackStackChanged() {
path = EXTERNAL_BASE_PATH;
int count = fragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = fragmentManager.getBackStackEntryAt(count - 1);
path = fragment.getName();
}
setTitle(path);
}
示例5: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
@Override
public void onBackStackChanged() {
int count = mFragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = mFragmentManager
.getBackStackEntryAt(count - 1);
mPath = fragment.getName();
} else {
mPath = EXTERNAL_BASE_PATH;
}
setTitle(mPath);
supportInvalidateOptionsMenu();
}
示例6: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
@Override
public void onBackStackChanged() {
int count = mFragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = mFragmentManager.getBackStackEntryAt(count - 1);
mPath = fragment.getName();
} else {
mPath = EXTERNAL_BASE_PATH;
}
setTitle(mPath);
if (HAS_ACTIONBAR)
supportInvalidateOptionsMenu();
}
示例7: onBackStackChanged
import android.support.v4.app.FragmentManager.BackStackEntry; //导入方法依赖的package包/类
@Override
public void onBackStackChanged() {
mPath = EXTERNAL_BASE_PATH;
int count = mFragmentManager.getBackStackEntryCount();
if (count > 0) {
BackStackEntry fragment = mFragmentManager
.getBackStackEntryAt(count - 1);
mPath = fragment.getName();
}
setTitle(mPath);
}