How to determine if the foreground app is the launcher?

后端 未结 1 1281
萌比男神i
萌比男神i 2021-01-24 04:09

I know how to retrieve information about the foreground app:

public ActivityManager.RunningTaskInfo getForegroundTask()
{
    ActivityManager am = (ActivityManag         


        
相关标签:
1条回答
  • 2021-01-24 04:53

    You can try to combine your code snippet to determine the package name of the foreground process with a call to PackageManager to get information about the HOME activity, as described here, and compare the results.

    0 讨论(0)
提交回复
热议问题