private boolean isTopActivity()
{
boolean isTop = false;
ActivityManager am = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
DebugLog.d(TAG, "isTopActivity = " + cn.getClassName());
if (cn.getClassName().contains(TAG))
{
isTop = true;
}
DebugLog.d(TAG, "isTop = " + isTop);
return isTop;
}
android 判断activity是否在最上层
最新推荐文章于 2024-08-16 09:25:39 发布