How to start activity in another application?

If you guys are facing “Permission Denial: starting Intent…” error or if the app is getting crash without any reason during launching the app – Then use this single line code in Manifest


Please be careful with finish(); , if you missed out it the app getting frozen. if its mentioned the app would be a smooth launcher.


The other solution only works for two activities that are in the same application. In my case, application B doesn’t know class com.example.MyExampleActivity.class in the code, so compile will fail.

I searched on the web and found something like this below, and it works well.

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.example", "com.example.MyExampleActivity"));

You can also use the setClassName method:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("", "");

You can also pass the values from one app to another app :

Intent launchIntent = getApplicationContext().getPackageManager().getLaunchIntentForPackage("");
if (launchIntent != null) {
    launchIntent.putExtra("AppID", "MY-CHILD-APP1");
    launchIntent.putExtra("UserID", "MY-APP");
    launchIntent.putExtra("Password", "MY-PASSWORD");
} else {
    Toast.makeText(getApplicationContext(), " launch Intent not available", Toast.LENGTH_SHORT).show();

Leave a Comment