Adobe AIR 24+ 在 Android 上首次恢复时出现黑屏问题

4
我知道多年来AIR已经有很多黑屏报告,但我觉得我遇到了一些独特的问题。我正在调试一个Android特定问题,我需要帮助解决一些问题,因为Android不是我的专长......
将一个Starling应用程序升级到AIR 24+后,在Android上仅在应用程序的第一次恢复时获得黑屏。第一次恢复时,我得到一个黑屏,顶部有状态栏,游戏明显在后台运行(调试器连接并播放音乐)。然而,我无法与游戏互动(正如其他黑屏线程中所报道的)。现在是有趣的部分,如果您强制停止应用程序并重新启动,则初始加载和所有后续挂起恢复操作都能完美地运行,没有黑屏。无论是调试还是发布构建,以及无论您从哪里启动应用程序,都没有关系。
我已经浏览了每个黑屏线程,但没有什么效果。我正在执行所有onActivate/onDeactivate stage.quality技巧,containsVideo标签等。我已经看到了使用singleTop launchMode的建议,它似乎可以解决这个问题。然而,我需要使用Android launchMode standard来维护活动堆栈(例如Facebook登录等)。
结论是,这可能不是典型的黑屏问题,我开始用adb shell调查Android活动状态,并发现了一些有趣的事情。在运行“adb shall dumpsys activity”时,我一直在比较我的应用程序在AIR 23和AIR 24+构建之间的活动意图任务,并注意到了一些奇怪的差异。以前,无论处于什么状态,我的应用程序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,但以前没有出现这种情况。再次说明,安卓不是我的强项,所以我不确定这是否是正确的功能,但它显然是错误的,我不确定该怎么做。虽然对我来说,似乎 AIR 24 中发生了某些改变,导致我的应用被破坏,但我想确保我没有做错任何事情。
非常乐意提供任何额外的信息,感谢所有的想法!
1个回答

0

在搜索了数小时后,这就是我所做的:

<activity android:launchMode="singleTop">
<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

launchMode更改为"singleTop"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接