【发布时间】:2017-08-12 00:25:33
【问题描述】:
我知道这些年来 AIR 报告了很多黑屏报告,但我觉得我遇到了一些截然不同的事情。我一直在调试一个特定于 Android 的问题,这让我遇到了一些我需要帮助的问题,因为 Android 不是我的强项...
使用 Starling 应用程序并升级到 AIR 24+,Android 现在仅在应用程序的第一次恢复时会出现黑屏。在第一次恢复时,我得到一个黑屏,顶部的状态栏和游戏在后台运行(调试器连接和音乐播放)。但是,我无法与游戏互动(正如其他黑屏线程中所报告的那样)。现在有趣的部分是,如果您强制停止应用程序并重新启动,初始加载和所有后续挂起恢复操作都可以完美运行,不会出现黑屏。无论是调试版本还是发布版本,以及如何/从何处启动应用程序都无关紧要。
我已经运行了所有黑屏线程,但没有任何效果。我正在做所有的 onActivate/onDeactivate stage.quality 技巧、containsVideo 标签等。我已经看到了使用 singleTop launchMode 的建议,这似乎可以解决问题。但是,我需要使用 Android launchMode 标准来维护活动堆栈(用于 facebook 登录等)。
得出的结论是,这可能不是典型的黑屏问题,我开始使用 adb shell 调查 Android 活动状态,并发现了一些有趣的事情。运行 'adb shall dumpsys activity' 我一直在比较 AIR 23 和 AIR 24+ 版本之间我的应用程序的活动 Intent 任务,并注意到一些奇怪的差异。以前,我的应用程序 Intent 将使用两个标志(NEW_TASK 和 RESET_TASK_IF_NEEDED)运行,无论它处于什么状态。但是,在 AIR 24+ 中,在第一次挂起时,活动正在失去它的 bnds(我相信这是屏幕坐标绑定???) 并且意图标志正在丢失 RESET_TASK_IF_NEEDED 值。
我在下面复制了相关的 adb 输出(抱歉,代码块似乎最易读)...
AIR 23 构建 任务列表在三个测试的游戏状态(在第一次启动后、第一次暂停后和第一次恢复后)保持不变(除了在堆栈之间移动):
Task id #801
TaskRecord{eb77f80 #801 A=air.com.toystudio.casinotower U=0 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} bnds=[1698,944][1998,1186] (has extras) }
Hist #0: ActivityRecord{649aa75 u0 air.com.toystudio.casinotower/.AppEntry t801}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} bnds=[1698,944][1998,1186] (has extras) }
ProcessRecord{aa9a5f3 16332:air.com.toystudio.casinotower/u0a382}
AIR 24+ 构建 首次启动后: (一切看起来都和 AIR 23 中的一样)
Task id #787
TaskRecord{1f215a7 #787 A=air.com.toystudio.casinotower U=0 sz=1}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} bnds=[1698,944][1998,1186] (has extras) }
Hist #0: ActivityRecord{6d91889 u0 air.com.toystudio.casinotower/.AppEntry t787}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} bnds=[1698,944][1998,1186] (has extras) }
ProcessRecord{b3c48a8 596:air.com.toystudio.casinotower/u0a375}
在第一次暂停之后: (注意 'flg' 的变化和现在缺失的 'bnds'。还要注意任务 id 是不同的,因为输出来自不同的测试)
Task id #798
TaskRecord{87c1429 #798 A=air.com.toystudio.casinotower U=0 sz=1}
Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }
Hist #0: ActivityRecord{148e44 u0 air.com.toystudio.casinotower/.AppEntry t798}
Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }
ProcessRecord{38791ba 14679:air.com.toystudio.casinotower/u0a381}
第一次恢复后(黑屏但游戏正在运行): (现在一切都被破坏了。不知何故,我列出了两个活动,都有不正确的标志,只有一个有窗口绑定)
Task id #785
TaskRecord{c0a012d #785 A=air.com.toystudio.casinotower U=0 sz=2}
Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }
Hist #1: ActivityRecord{924bd86 u0 air.com.toystudio.casinotower/.AppEntry t785}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10600000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} bnds=[1698,944][1998,1186] (has extras) }
ProcessRecord{df8d47f 31595:air.com.toystudio.casinotower/u0a375}
Hist #0: ActivityRecord{38d61a1 u0 air.com.toystudio.casinotower/.AppEntry t785}
Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=air.com.toystudio.casinotower/.AppEntry VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }
ProcessRecord{df8d47f 31595:air.com.toystudio.casinotower/u0a375}
这是我的核心 Android 活动 xml:
<activity
android:excludeFromRecents="false"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:scheme="casinotower" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
一旦您强制关闭并再次开始使用该应用程序,任务时间线就会与 AIR 23 构建相匹配。我正在寻找关于第一次暂停到我的 flg 和 bnds 状态时可能发生的事情的建议。我运行了许多 ANE,但他们以前都没有这样做过。再说一次,Android 不是我的强项,所以我不确定这是否是正确的功能,但它肯定看起来明显不正确,我不确定从这里去哪里。虽然在我看来,AIR 24 中的某些更改正在破坏我的应用程序,但我想确保我没有做错任何事情。
很高兴提供任何其他信息,感谢任何想法!
【问题讨论】:
标签: android android-intent android-activity air adobe