2

I am currently using this code to retrieve process name:

 List<ActivityManager.RunningTaskInfo> taskInfo = am.getRunningTasks(1);
     if(taskInfo.get(0).topActivity.getPackageName().equalsIgnoreCase("xxxxxxxx") != true){

        ////com.xxx.xxx

     }

What I am trying to achieve is to get the active 'window' title, for example, when I open a web browser the title is "www.google.com" and if I open a conversation with Mister X in SMS/MMS, the current title is "Mister X 0245478767".

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Nikita
  • 189
  • 1
  • 4
  • 16

1 Answers1

-1

Activity class has method getTitle() that might give what you are looking for. I just don't know how to use it through ActivityManager or is it even possible to call it from another app.

Kuitsi
  • 1,675
  • 2
  • 28
  • 48
  • I guess you don't have any control of those other apps, so [Broadcasts](http://stackoverflow.com/a/12339345/262462) are not useful either – Kuitsi Feb 23 '13 at 09:08