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 );
Post a Comment for "Launch Another App Within An App For Android"