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?