Android14 与三星折叠设备。 UnsupportedOperationException:尝试从与一个不关联的上下文获取显示

问题描述 投票:0回答:1

我在实时应用程序上遇到 UnsupportedOperationException 崩溃。所有崩溃都与三星 Fold Android 14 设备有关。但仍然不知道如何重现或解决这个问题。任何帮助将不胜感激。

Fatal Exception: java.lang.UnsupportedOperationException: Tried to obtain display from a Context not associated with one. Only visual Contexts (such as Activity or one created with Context#createWindowContext) or ones created with Context#createDisplayContext are associated with displays. Other types of Contexts are typically related to background entities and may return an arbitrary display.
       at android.app.ContextImpl.getDisplay(ContextImpl.java:3166)
       at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
       at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
       at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
       at androidx.window.extensions.layout.WindowLayoutComponentImpl.shouldReportDisplayFeatures(WindowLayoutComponentImpl.java:355)
       at androidx.window.extensions.layout.WindowLayoutComponentImpl.getDisplayFeatures(WindowLayoutComponentImpl.java:313)
       at androidx.window.extensions.layout.WindowLayoutComponentImpl.getWindowLayoutInfo(WindowLayoutComponentImpl.java:265)
       at androidx.window.extensions.layout.WindowLayoutComponentImpl.onDisplayFeaturesChanged(WindowLayoutComponentImpl.java:250)
       at androidx.window.extensions.layout.WindowLayoutComponentImpl.$r8$lambda$CcdqSJgN0v7j8yjFplaR5_gC_ag()
       at androidx.window.extensions.layout.WindowLayoutComponentImpl$ExternalSyntheticLambda0.accept(:4)
       at androidx.window.util.BaseDataProducer.notifyDataChanged(BaseDataProducer.java:101)
       at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.notifyFoldingFeatureChange(DeviceStateManagerFoldingFeatureProducer.java:212)
       at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.-$Nest$mnotifyFoldingFeatureChange()
       at androidx.window.common.DeviceStateManagerFoldingFeatureProducer\$1.$r8$lambda$Cq8m54r9pahGe0xgKiimh_L76YM()
       at androidx.window.common.DeviceStateManagerFoldingFeatureProducer\$1$ExternalSyntheticLambda0.accept(:4)
       at androidx.window.common.RawFoldingFeatureProducer.getData(RawFoldingFeatureProducer.java:71)
       at androidx.window.common.DeviceStateManagerFoldingFeatureProducer\$1.onStateChanged(DeviceStateManagerFoldingFeatureProducer.java:87)
       at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper.lambda$notifyStateChanged\$2(DeviceStateManagerGlobal.java:428)
       at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper.$r8$lambda$FiFeo7UDl_Jzgv3ijVmtwGDn8K0()
       at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper$ExternalSyntheticLambda0.run(:4)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8919)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
crash samsung-galaxy android-14 unsupportedoperation
1个回答
0
投票

看到类似的崩溃,目前还没有任何线索

© www.soinside.com 2019 - 2024. All rights reserved.