1、PackageManager的resolveActivityspa
public abstract ResolveInfo resolveActivity(Intent intent, int flags);
getPackageManager().resolveActivity();
返回可以匹配的Intent,若是不能匹配就返回NULL,code
2、PackageManager的queryIntentActivitiescomponent
public abstract List<ResolveInfo> queryIntentActivities(Intent intent, int flags);
getPackageManager().queryIntentActivities(intent,PackageManager.MATCH_DEFAULT_ONLY);
返回全部成功匹配的Activity信息blog
3、Intent的resolveActivityget
public ComponentName resolveActivity(PackageManager pm)
Intent intent = new Intent(); ComponentName componentName = intent.resolveActivity();
第一個參數表明Intentit
第二個參數:設置PackageManager.MATCH_DEFAULT_ONLYclass