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.
我想知道如何检查在android中启动了哪个应用程序。例如,当启动某个游戏或打开浏览器时,我的应用程序会知道该应用程序已启动。有没有办法找出这个东西?
此代码是检查服务已启动,我认为这很可能与活动有关
ActivityManager activityManager=(ActivityManager)this.getSystemService(ACTIVITY_SERVICE); List<RunningServiceInfo> list= activityManager.getRunningServices(70);