首次恢复Adobe AIR 24+ Android黑屏

时间:2017-03-20 16:05:34

标签: android android-intent android-activity air adobe

我知道AIR多年来一直有很多黑屏报道,但我觉得我遇到了截然不同的事情。我一直在调试Android特定问题,它引导我提出一些我需要帮助的问题,因为Android不是我的强项...

使用Starling应用程序并升级到AIR 24+,Android现在仅在应用程序的第一个简历上获得黑屏。在第一次恢复时,我得到一个黑色的屏幕,状态栏在顶部,游戏清晰地在后台运行(调试器连接和音乐播放)。但是,我无法与游戏进行交互(正如其他黑屏线程中所报道的那样)。现在对于有趣的部分,如果您强制停止应用程序并重新启动,初始加载和所有后续挂起恢复操作完美地工作,没有黑屏。如果它是调试或发布版本并不重要,并且与启动应用程序的方式无关。

我已经浏览了每个黑屏线程,但没有任何工作。我正在做所有的onActivate / onDeactivate stage.quality技巧,包含视频标签等。我已经看到了使用singleTop launchMode的建议,它似乎确实解决了这个问题。但是,我需要使用Android launchMode标准进行活动堆栈维护(对于facebook登录等)。

总结说这可能不是典型的黑屏问题,我开始使用adb shell调查Android活动状态,并且我发现了一些有趣的事情。运行' adb将dumpsys活动'我已经在AIR 23和AIR 24+版本之间比较了我的应用程序的活动Intent任务,并注意到一些奇怪的差异。以前,我的应用程序Intent将运行两个标志(NEW_TASK和RESET_TASK_IF_NEEDED),无论它处于什么状态。但是,在AIR 24+中,在第一次暂停时,活动正在丢失它的bnds(我相信是屏幕坐标绑定???)并且意图标志正在丢失RESET_TASK_IF_NEEDED值。

我已经复制了下面的相关adb输出(抱歉,但代码块似乎最具可读性)......

AIR 23 Build 任务列表保持不变(除了在堆栈之间移动)通过三个测试的游戏状态(刚刚首次启动之后,刚刚首次暂停之后,以及刚刚首次恢复之后):

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+ Build 刚刚首次推出后: (一切看起来都与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不是我的强大套件,所以我不确定这是否是正确的功能,但它肯定显得有些不正确,我不确定从哪里开始。虽然在我看来AIR24中的某些内容已经改变了我的应用程序,但我想确保我没有做错任何事情。

很高兴提供任何其他信息,我很感激任何想法!

1 个答案:

答案 0 :(得分: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"