我想要的是我需要对前台任何应用程序的当前 Activity 的引用。
基本上我已经编写了一个服务,我想获得对该服务中“当前”前台 Activity 的引用。 “当前”是指除了启动该服务的应用程序 Activity 之外的任何应用程序 Activity 。
最佳答案
What I want is that I need the reference to the current Activity of ANY application that is on the foreground.
那是不可能的。其他应用程序在其他进程中运行;您无权访问那些进程中的 Java 对象,例如 Activity
实例。
关于android - 在其他应用程序编写的服务中获取任何应用程序的前台 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30760852/