/** * @return 手机当前的activity */ String getRunningActivityName(){ ActivityManager activityManager=(ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); String runningActivity=activityManager.getRunningTasks(1).get(0).topActivity.getClassName(); return runningActivity; }
得到手机当前显示的activity的名字,布布扣,bubuko.com
原文:http://www.cnblogs.com/tianzhijiexian/p/3905649.html