V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Icex
V2EX  ›  Android

Presentation 副屏显示问题

  •  
  •   Icex · Jun 27, 2019 · 14182 views
    This topic created in 2502 days ago, the information mentioned may be changed or developed.

    Configuration 发生变化之后 Presentation 怎么显示 自定义的 Application 的 attachBaseContext 方法里面调用了 context =context.createConfigurationContext(config)来设置语言配置信息,但是调用后发现 Presentation 在创建时,onStart()方法在执行时检查显示指示发生了变化 if (!isConfigurationStillValid()) { Log.i(TAG, "Presentation is being dismissed because the " + "display metrics have changed since it was created."); mHandler.sendEmptyMessage(MSG_CANCEL); } ,然后会关闭 Presentation。

    想请教一下,context.createConfigurationContext(config)要如何设置才行保持 Presentation 获得的 DisplayMetrics 不变呢

    6 replies    2023-08-29 14:53:51 +08:00
    raiz
        1
    raiz  
       Jun 28, 2019
    兄弟! 我差点以为我是全网唯一一个用到这玩意的。。
    acidsweet
        2
    acidsweet  
       Jul 1, 2019
    @raiz 线下机具很多双屏的啊
    raiz
        3
    raiz  
       Jul 2, 2019
    @acidsweet 是的,但是他们都不会在线上讨论此类技术,我是做 点歌应用用到的。 @Icex sorry, 我暂时很忙,没研究。
    Icex
        4
    Icex  
    OP
       Nov 1, 2019
    @raiz 我这边后面找到原因了,同事重写 Application 的 attachBaseContext(Context base)方法时,传入父类 super.attachBaseContext()的 Context 参数更换成了 context.createConfigurationContext(config)创建的 context,所以才导致了两次获取到的 DisplayMetrics 不一样
    Icex
        5
    Icex  
    OP
       Nov 1, 2019
    @raiz 我这边经常用到双屏异显,现在还要 3 显,在群里确实没怎么看到这些方面的知识讨论
    zongren
        6
    zongren  
       Aug 29, 2023
    想问下两位 presentation 像素密度怎么修改?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   958 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 18:11 · PVG 02:11 · LAX 11:11 · JFK 14:11
    ♥ Do have faith in what you're doing.