Skip to content

Commit

Permalink
Fixed: record N/A in TopActivity when sdk is higher than 21
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewleo committed Mar 10, 2017
1 parent 2ad075f commit 211fcd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/netease/qa/emmagee/utils/ProcessInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public static String getTopActivity(Context context) {
ActivityManager manager = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
// Note: getRunningTasks is deprecated in API 21(Official)
// if (Build.VERSION.SDK_INT >= 21) {
// return Constants.NA;
// }
if (Build.VERSION.SDK_INT >= 21) {
return Constants.NA;
}
List<RunningTaskInfo> runningTaskInfos = manager.getRunningTasks(1);
if (runningTaskInfos != null)
return (runningTaskInfos.get(0).topActivity).toString();
Expand Down

0 comments on commit 211fcd5

Please sign in to comment.