判断隐式Intent是否有响应

PackageManager manager = getContext().getPackageManager();
if (manager.queryIntentActivities(intent, 0).size() > 0) {
  startActivity(intent);
}
// Verify that the intent will resolve to an activity
if (sendIntent.resolveActivity(getPackageManager()) != null) {
    startActivity(sendIntent);
}

原文地址:https://www.cnblogs.com/H-BolinBlog/p/8874441.html