3

What I want is that I need the reference to the current Activity of ANY application that is on the foreground.

Basically I have written a service and I want to get the reference to the "current" foreground activity in that service. With "current" I mean any application activity other than the one that has started that service.

Adil Sarwar
  • 122
  • 1
  • 10

1 Answers1

0

What I want is that I need the reference to the current Activity of ANY application that is on the foreground.

That is not possible. Other applications are running in other processes; you do not have access to Java objects, such as Activity instances, in those processes.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491