判断隐式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);
}

 

 


posted @ 2018-04-18 14:01  H_bolin  阅读(206)  评论(0编辑  收藏  举报