When creating an Intent, you can pass the explicit name of the component. i.e. class name . Only this component will now receive the intention.
Example:
Intent myIntent = new Intent(getApplicationContext(),RequiredActivity.class); startActivity(myIntent);
If you do not specify the exact component, Android will allow the user to select one of the components that processes the intent.
Example:
Intent myIntent = new Intent(Intent.ACTION_VIEW); startActivity(myIntent);
If you want to go through all the components that handle the intent, you yourself, instead of letting users show Android versions, you can also do this:
Example:
Intent myIntent = new Intent(Intent.ACTION_VIEW); List<ResolveInfo> infoList = getPackageManager().queryIntentActivities(myIntent, 0); for (ResolveInfo ri : infoList){ ActivityInfo ai = ri.activityInfo; String packageName = ai.packageName; String componentName = ai.name;
I got six activity matches for the code above:

source share