Launching Android App, Within An App?
I'm writing a basic application. One of the features I'm interested in trying to do is to launch another app, INSIDE the app already running. Eg. I have an app with 3 menu options
Solution 1:
This is possible with the Intents mechanism.
The exact Intent you'll have to write depend on various factors:
- do you have to provide some data to the launched application?
- do you target a specific application or do you want to let the user choose the application he prefers for that task (in case he has several applications able to do what you need)?
- do you want to ensure that the application is available? (that would be better)
- do you know if the other app provides specific intent-filters to do some tasks?
Edit:
Then, you should be able to start the second application with the following code:
Intenti=newIntent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setPackage("com.otherapp.package");
startActivity(i);
Place this code in the OnClickListener of your button and that should be enough.
Post a Comment for "Launching Android App, Within An App?"