Android 检查启动了哪个应用程序?
我想知道如何检查哪个应用程序是在android中启动的。例如,当某个游戏启动或浏览器打开时,我的应用程序就会知道这个应用程序已经启动。到底有没有办法弄清楚这件事 这段代码是检查服务是否启动,我认为这很可能与活动有关Android 检查启动了哪个应用程序?,android,android-intent,android-launcher,Android,Android Intent,Android Launcher,我想知道如何检查哪个应用程序是在android中启动的。例如,当某个游戏启动或浏览器打开时,我的应用程序就会知道这个应用程序已经启动。到底有没有办法弄清楚这件事 这段代码是检查服务是否启动,我认为这很可能与活动有关 ActivityManager activityManager=(ActivityManager)this.getSystemService(ACTIVITY_SERVICE); List<RunningServiceInfo> list= activityMan
ActivityManager activityManager=(ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List<RunningServiceInfo> list= activityManager.getRunningServices(70);
ActivityManager ActivityManager=(ActivityManager)this.getSystemService(ACTIVITY_服务);
List=activityManager.getRunningServices(70);
您是否尝试过这种方法和这种方法?