Skip to content Skip to sidebar Skip to footer

Launch Another App Within An App For Android

I am new to Android. Say, I open an app and I would like to open another App after clicking a button. How can I accomplish this task? Would appreciate if you can provide me some tu

Solution 1:

Intentintent=newIntent();    
intent.setClassName("**package.name**", "**package.name.LauncherActivityName**");
startActivityForResult(intent,REQUEST_CODE);

You need to know the package and class names of the activity to call

Solution 2:

Intenti=newIntent(Intent.ACTION_MAIN);
PackageManagermanager= getPackageManager();
i = manager.getLaunchIntentForPackage("app package name");
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);

Solution 3:

Use this code:

IntentlaunchIntent= getPackageManager().getLaunchIntentForPackage("com.example.package");
startActivity(launchIntent);

The app you want to launch must be on the device.

Solution 4:

IntentappIntent= getPackageManager().getLaunchIntentForPackage("your app package name ");
startActivity(appIntent );

Solution 5:

If the other application is a pre-packaged application mean, this tutorial may help you.

If the other application is going to be your application, then you need to learn Implicit Intent tutorials.

Post a Comment for "Launch Another App Within An App For Android"