当前位置: 首页>>代码示例>>Java>>正文


Java BackStackEntry.getName方法代码示例

本文整理汇总了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);
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:24,代码来源:RMBTMainActivity.java

示例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();
}
 
开发者ID:qiniudemo,项目名称:qiniu-lab-android,代码行数:18,代码来源:FileChooserActivity.java

示例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();
}
 
开发者ID:dc914337,项目名称:PSD-Android-App,代码行数:16,代码来源:FileChooserActivity.java

示例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);
}
 
开发者ID:4thline,项目名称:feeds,代码行数:10,代码来源:FileChooserActivity.java

示例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();
}
 
开发者ID:vishalvijay,项目名称:vtu-life-android,代码行数:16,代码来源:FileChooserActivity.java

示例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();
}
 
开发者ID:SecrecySupportTeam,项目名称:Secrecy_fDroid_DEPRECIATED,代码行数:16,代码来源:FileChooserActivity.java

示例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);
}
 
开发者ID:jcuenod,项目名称:brainrot,代码行数:14,代码来源:FileChooserActivity.java


注:本文中的android.support.v4.app.FragmentManager.BackStackEntry.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。