问题
I have source code of two different application.In a separate Project I want to start an application with choice that if a user click option 1 then go to first application and if click on next button then to other application. I made a main page with buttons. Now how do I achieve this task.
回答1:
If you have to applications that should be started by a third (yours) then make sure those two are installed on your device and start them via Intent
from your third.
回答2:
That's easy. Look at the /system/bin/am
command (here: How to start an Android application from the command line?). You can run it from your code with Runtime.getRuntime().exec()
.
回答3:
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("PACKAGE NAME OF THE OTHER APPLICATION");
startActivity(LaunchIntent);
Replace "PACKAGE NAME OF THE OTHER APPLICATION" with the package name of the application that you want to run
回答4:
You can make a new Activity with 2 buttons and make it MainActvity. From button 1 call MainActivity of the 1st app and from 2nd button call MainActivity of 2nd app using Intent and startActivity().
And make necessary changes in AndroidManifest.xml
来源:https://stackoverflow.com/questions/13439380/android-merging-two-diffrent-application-into-one