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.
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.