Android: merging two diffrent application into one

感情迁移 提交于 2019-12-13 04:09:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!