启动其他应用程序里面的Andr​​oid应用程序应用程序、里面、oid、Andr

2023-09-06 22:58:04 作者:lay,爱你不累

是否有可能为启动其他应用程序,同时内部的应用程序?是否有任何其他的解决方案,以启动其他应用程序?

我用这个code调用其他应用程序从我的启动应用程序

 意图LaunchIntent =新的意图(Intent.ACTION_MAIN);
LaunchIntent = getPackageManager()getLaunchIntentForPackage(com.exaple.sampleapp);
startActivity(LaunchIntent);
 

解决方案

你是什么意思的在是什么意思?像你的应用程序作为一个容器?

当你启动其他应用程序,你做的方式,这就像你通过挖掘其上的应用程序抽屉图标打开该应用程序。该应用程序将运行在它自己的进程,而不是在您的应用程序。

通过这样做,你的应用程序将在后台把作为打开应用程序转到前台。

Is it possible to launch another application while inside an application? Is there any other solution to launch another application?

I used this code to call another application from my launching application

Intent LaunchIntent = new Intent(Intent.ACTION_MAIN); 
LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.exaple.sampleapp");     
startActivity(LaunchIntent);

解决方案

What do you mean by inside ? Like your app acting as a container ?

When you launch another application the way you did, it is like you opened that app by tapping into its icon on the application drawer. The application will run on its own process and not inside your app.

By doing this, your app will be put at background as the opened app goes to the foreground.