If you need to switch applications, you need to use getRunningTasks to get the running application and determine whether the package name to be opened is in this list. If it is, use the moveTaskToFront method of activityManager to move the application to the top of the stack
Start by package name
If you need to switch applications, you need to use getRunningTasks to get the running application and determine whether the package name to be opened is in this list. If it is, use the moveTaskToFront method of activityManager to move the application to the top of the stack
Questioner: Have you solved this problem? ? It seems that there is a bug in the method test above