Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想检查最上面运行的应用程序,我的意思是用户正在使用的最上面的应用程序。是否有可能做到这一点,BroadcastReceiver或者只能通过在其中Service实现 a来完成Handler?
BroadcastReceiver
Service
Handler
ActivityManager 有一些方法,例如 getRunningAppProcesses 或 getRecentTasks 可以提供帮助。