Question

I have two application. I want to intent to the second one from the first one. But the second application must be launched from first one. So i have to hide the second one's icon.

When i delete the category tag from the second one's manifest.xml, icon is disappearing. But this time i can't launch the second app from the first app with intent.

This is how i tried to intent:

Intent openvideo = getPackageManager().getLaunchIntentForPackage("air.deneme");
startActivity(openvideo);

How can i handle it?

Both of the applications are view based, they aren't background applications.

Was it helpful?

Solution

ComponentName lComponentName= new ComponentName(yourPackageNameOFApplication2, yourPackageNameOFApplication2.YourMainActivityOfApplication2);

        try {
            Intent i = new Intent(Intent.ACTION_MAIN);
            i.setComponent(lComponentName);
            i.addCategory(Intent.CATEGORY_LAUNCHER);
            startActivity(i);
        } catch (ActivityNotFoundException e) {
            e.printStackTrace();
            // Write Toast , we will have an exception if the second application is not installed
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top