我正在使用以下代码获取android中当前正在运行的Activity名称。ActivityManageram=(ActivityManager)aContext.getSystemService(Context.ACTIVITY_SERVICE);Listalltasks=am.getRunningTasks(1);ComponentNamecomponentInfo=alltasks.get(0).topActivity;componentInfo.getClassName();System.out.println("Current:"+componentInfo.getClassN