android – Calling an app from another app-ThrowExceptions

Exception or error:

In this app I’m developing I need to load/call another app that is already installed on the phone. It’s an application for my own personal use only, so no need to check if the other app is installed – I know it is.

I’ve googled this problem for hours, but I can’t find anything that works. Mostly because the guidelines for finding package name and class name are really bad.

Via cmd and adb I was able to find that the info regarding the application I’d like to call is:
(that’s exactly what it said in the cmd window.)

I tried something like this:

Intent i = new Intent();
i.setClassName("/data/app/", "");

But my app just crashes instead. I used the above code because someone said that this could call an app:

Intent i = new Intent();
i.setClassName("<package_name>","<Class Name(with package name)>");

Does anyone know what to really write?

P.S.: my own app does not need any information about what’s happening in the called app.

How to solve:

Use the PackageManager to get an Intent for the package:

PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.example.package");


The documentation is

I think in your example, is in fact the package name, so that should be the first argument. For the second one, you still need to figure out the class to use.

If you don’t have the code, you can check how to find out the class from the apk with this.

Leave a Reply

Your email address will not be published. Required fields are marked *