Android intent's resolveActivity and Package Manager
问题 To check if an intent can be handled, you would call: if (intent.resolveActivity(getPackageManager()) != null) { // start activity } Question - why is the parameter to package manager needed if the same getPackageManager() is always passed? Are there cases where different package manager may be passed? 回答1: Package Manager is like a registry. it contains all details of application as given below that's why you are providing package manager args to resolve intent before the fire. alternatively