草庐IT

android - 首次恢复时 Adob​​e AIR 24+ Android 黑屏

coder 2023-12-24 原文

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

采用 Starling 应用程序并升级到 AIR 24+,Android 现在仅在应用程序的第一个 恢复时出现黑屏。第一次恢复时,我看到黑屏,顶部有状态栏,游戏在后台运行(调试器连接和音乐播放)。但是,我无法与游戏互动(正如其他黑屏线程中所报告的那样)。现在有趣的部分是,如果您强行停止应用程序并重新启动,初始加载和所有后续暂停恢复操作将完美运行,不会出现黑屏。无论是调试版本还是发布版本,以及如何/从何处启动应用程序都无关紧要。

我已经遍历了每一个黑屏线程,但没有任何效果。我正在执行所有 onActivate/onDeactivate stage.quality 技巧、containsVideo 标签等。我看到了使用 singleTop launchMode 的建议,这似乎确实可以解决问题。但是,我需要使用 Android launchMode 标准来维护 Activity 堆栈(用于 facebook 登录等)。

断定这可能不是典型的黑屏问题后,我开始使用 adb shell 调查 Android Activity 状态,并且发现了一些有趣的事情。运行“adb shall dumpsys activity” 我一直在比较我的应用程序在 AIR 23 和 AIR 24+ 构建之间的 Activity Intent 任务,并注意到一些奇怪的差异。以前,无论它处于什么状态,我的应用程序 Intent 都会以两个标志(NEW_TASK 和 RESET_TASK_IF_NEEDED)运行。但是,在 AIR 24+ 中,在第一次暂停时, Activity 正在失去它的 bnds(我认为这是屏幕坐标绑定(bind)???) 并且 Intent 标志正在丢失 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+ 版本 首次启动后: (一切看起来都和 AI​​R 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}

就在第一次恢复之后(黑屏但游戏正在运行): (现在一切都乱七八糟了。我不知何故列出了两个 Activity ,都有不正确的标志,只有一个有窗口绑定(bind))

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 Activity 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 中的某些更改正在破坏我的应用程序,但我想确保我没有做错任何事情。

很高兴提供任何额外的信息,我很感激任何想法!

最佳答案

这是我搜索了几个小时后所做的:

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

launchMode 更改为 "singleTop"

关于android - 首次恢复时 Adob​​e AIR 24+ Android 黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42908456/

有关android - 首次恢复时 Adob​​e AIR 24+ Android 黑屏的更多相关文章

  1. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  2. ruby - 使用 `+=` 和 `send` 方法 - 2

    如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:

  3. 安卓apk修改(Android反编译apk) - 2

    最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路

  4. ruby - 如何计算 Liquid 中的变量 +1 - 2

    我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我

  5. arrays - Ruby 数组 += vs 推送 - 2

    我有一个数组数组,想将元素附加到子数组。+=做我想做的,但我想了解为什么push不做。我期望的行为(并与+=一起工作):b=Array.new(3,[])b[0]+=["apple"]b[1]+=["orange"]b[2]+=["frog"]b=>[["苹果"],["橙子"],["Frog"]]通过推送,我将推送的元素附加到每个子数组(为什么?):a=Array.new(3,[])a[0].push("apple")a[1].push("orange")a[2].push("frog")a=>[[“苹果”、“橙子”、“Frog”]、[“苹果”、“橙子”、“Frog”]、[“苹果”、“

  6. += 的 Ruby 方法 - 2

    有没有办法让Ruby能够做这样的事情?classPlane@moved=0@x=0defx+=(v)#thisiserror@x+=v@moved+=1enddefto_s"moved#{@moved}times,currentxis#{@x}"endendplane=Plane.newplane.x+=5plane.x+=10putsplane.to_s#moved2times,currentxis15 最佳答案 您不能在Ruby中覆盖复合赋值运算符。任务在内部处理。您应该覆盖+,而不是+=。plane.a+=b与plane.a=

  7. ruby - Sinatra + Heroku + Datamapper 使用 dm-sqlite-adapter 部署问题 - 2

    出于某种原因,heroku尝试要求dm-sqlite-adapter,即使它应该在这里使用Postgres。请注意,这发生在我打开任何URL时-而不是在gitpush本身期间。我构建了一个默认的Facebook应用程序。gem文件:source:gemcuttergem"foreman"gem"sinatra"gem"mogli"gem"json"gem"httparty"gem"thin"gem"data_mapper"gem"heroku"group:productiondogem"pg"gem"dm-postgres-adapter"endgroup:development,:t

  8. ruby - Ruby 中字符串运算符 + 和 << 的区别 - 2

    我是Ruby和这个网站的新手。下面两个函数是不同的,一个在函数外修改变量,一个不修改。defm1(x)x我想确保我理解正确-当调用m1时,对str的引用被复制并传递给将其视为x的函数。运算符当调用m2时,对str的引用被复制并传递给将其视为x的函数。运算符+创建一个新字符串,赋值x=x+"4"只是将x重定向到新字符串,而原始str变量保持不变。对吧?谢谢 最佳答案 String#+::str+other_str→new_strConcatenation—ReturnsanewStringcontainingother_strconc

  9. ruby - rails 3.2.2(或 3.2.1)+ Postgresql 9.1.3 + Ubuntu 11.10 连接错误 - 2

    我正在使用PostgreSQL9.1.3(x86_64-pc-linux-gnu上的PostgreSQL9.1.3,由gcc-4.6.real(Ubuntu/Linaro4.6.1-9ubuntu3)4.6.1,64位编译)和在ubuntu11.10上运行3.2.2或3.2.1。现在,我可以使用以下命令连接PostgreSQLsupostgres输入密码我可以看到postgres=#我将以下详细信息放在我的config/database.yml中并执行“railsdb”,它工作正常。开发:adapter:postgresqlencoding:utf8reconnect:falsedat

  10. ruby - 在 Ruby + Chef 中检查现有目录失败 - 2

    这是我在ChefRecipe中的一blockRuby:#ifdatadirdoesn'texist,moveoverthedefaultoneif!File.exist?("/vol/postgres/data")execute"mv/var/lib/postgresql/9.1/main/vol/postgres/data"end结果是:Executingmv/var/lib/postgresql/9.1/main/vol/postgres/datamv:inter-devicemovefailed:`/var/lib/postgresql/9.1/main'to`/vol/post

随机推荐