use of android.app.ActivityManager.RunningTaskInfo in project SmartCampus by Vegen.
the class EaseCommonUtils method getTopActivity.
/**
* get top activity
* @param context
* @return
*/
public static String getTopActivity(Context context) {
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> runningTaskInfos = manager.getRunningTasks(1);
if (runningTaskInfos != null)
return runningTaskInfos.get(0).topActivity.getClassName();
else
return "";
}
Aggregations