private ComponentName getTopActivity() {
final ActivityManager am = (ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE);
ActivityInfo aInfo = null;
List<RunningTaskInfo> list = am.getRunningTasks(1);
if (list.size() != 0) {
RunningTaskInfo topRunningTask = list.get(0);
return topRunningTask.topActivity;
} else {
return null;
}
}
final ActivityManager am = (ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE);
ActivityInfo aInfo = null;
List<RunningTaskInfo> list = am.getRunningTasks(1);
if (list.size() != 0) {
RunningTaskInfo topRunningTask = list.get(0);
return topRunningTask.topActivity;
} else {
return null;
}
}