List of usage examples for android.app ActivityManager getRecentTasks
@Deprecated public List<RecentTaskInfo> getRecentTasks(int maxNum, int flags) throws SecurityException
From source file:mobisocial.musubi.ui.FeedIdentityGrid.java
String getCallerAppId() { ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); List<RecentTaskInfo> infos = manager.getRecentTasks(1, 0); if (infos.size() == 0) { Log.w(TAG, "couldn't get info"); return null; }/*from w w w . ja v a 2 s . com*/ Intent base = infos.get(0).baseIntent; return base.getComponent().getPackageName(); }