Can two different apps have the same packageName?

Is this possible?

Sure.

It's 'cause a "failure" of the intent

No, at least not for my definition of "failure".

or because many apps packageNames have the same name?

No.

It is because you are querying for activities, not applications. An application can have zero, one, two, or a million activities that will respond to an ACTION_MAIN Intent.


No, every app should have a unique package name. If you install an app with a package name which is already used in another installed app, then it will replace it.

So there should be other reasons. One guess is queryIntentActivities retrieves all activities that can be performed for the given intent. So it can returns activities info with the same package name.

You can try using getInstalledApplications method. It will return a List of all application packages that are installed on the device


Every application must have a uniqe package name. To quote from the API guide: "The package name serves as a unique identifier for the application" and "Once you publish your application, you cannot change the package name. The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version."

Note that having multiple ACTION_MAIN entries in a single manifest is perfectly valid as they represent alternative entry points into the application. See this question for more information.