在 Air 的“新窗口"中打开另一个 Android 应用程序 [英] opening another Android app in a 'new window' from Air

查看:19
本文介绍了在 Air 的“新窗口"中打开另一个 Android 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这涉及到一点,请耐心等待.

This is a little involved, so bear with me.

我有两个 Android 应用程序 - 一个内置于 Adob​​e Air(启动器")和一个从 Google Play 商店(目标")下载的应用程序.在某个时刻,我希望启动器"打开目标"并切换到它.目前我正在通过意图"协议执行此操作,如下所示:

I've got two Android apps - one built in Adobe Air (the 'launcher') and one downloaded from the google play store (the 'target.') At a certain point I want the 'launcher' to open the 'target' and switch to it. Currently I'm doing this via the 'intent' protocol, like so:

navigateToURL(new URLRequest('intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;component=com.magix.camera_mx/com.magix.android.cameramx.main.MainMenu;end'));

... 它可以工作,但是当目标"(在本例中为 CameraMX)打开时,它使用与启动器"应用程序相同的窗口".这是打开目标"之前和之后的两个屏幕截图:

... and it works, but when the 'target' (CameraMX in this example) opens, it uses the same 'window' as the 'launcher' app. Here's two screenshots, before and after opening the 'target:'

这很不方便,但如果它是一致的,我可以忍受.但是,当我尝试完全相同的过程时,只启动了任意其他应用程序,例如金山办公:

That's inconvenient, but I could put up with it if it was consistent. However, when I try the exact same process, only launching an arbitrary other app like Kingsoft Office:

navigateToURL(new URLRequest('intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;component=cn.wps.moffice_eng/cn.wps.moffice.documentmanager.PreStartActivity;end'));

目标"和启动器"作为漂亮的独立窗口存在.

The 'target' and 'launcher' exist as nice separate windows.

这是为什么?什么决定了应用程序是作为单独的窗口出现,还是重用当前的窗口?我已经尝试了一些 - 特别是 SoulCraft 和 Starchart 在新窗口中启动,但大多数其他人都重用了当前窗口.

Why is that? What dictates whether an app comes up as a separate window, or reuses the current one? I've tried it with a handful - notably SoulCraft and Starchart launch in a new windows, but mostly the others all reuse the current window.

这是我可以在我的 air 应用程序中控制的吗?这是怎么回事?

Is that something I have control over from within my air app? What's going on here?

推荐答案

您所说的窗口"在 Android 中被称为任务".您应该能够通过设置适当的 flags,即FLAG_ACTIVITY_NEW_TASK(注意launchFlags=0x10000000):

What you're calling a "window" is referred to in Android as a "task". You should be able to force the target application to open in a new task by setting appropriate flags, namely FLAG_ACTIVITY_NEW_TASK (note the launchFlags=0x10000000):

intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10000000;component=<your-package-name>/.<your-activity-name>;end

这篇关于在 Air 的“新窗口"中打开另一个 Android 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆