android how to get current activity

Solutions on MaxInterview for android how to get current activity by the best coders in the world

showing results for - "android how to get current activity"
Samuel
23 May 2017
1ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
2ComponentName cn = am.getRunningTasks(1).get(0).topActivity;