Skip to main content

[Android] 최상위 액티비티 정보 가져오기

ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

 

List<RunningTaskInfo> info = manager.getRunningTasks(1);

ComponentName cn = info.get(0).topActivity;

 

String packageName = cn.getPackageName();

String activityName = cn.getShortClassName().substring(1);

 

댓글 남기기