SysUtils﹕ ApplicationContext is null in ApplicationStatus (WebView)

前端 未结 1 1024

I can see something strange at WebView based app start. It doesn\'t affect the app at all but I\'m curious why the error appears. Nothing crashes, everything seems to be ok, but

相关标签:
1条回答
  • 2021-02-12 10:26

    What is happening here is:

    The ApplicationStatus is not initialized yet, so the context cannot be obtained from it. This is a completely natural situation, so no error should be raised. Logging this as an error was an exaggeration from the coder.

    However:

    This does not cause any real problem, because the function tries to get a context object only to perform yet another check to assess the performance capabilities of the device. Since it sometimes fails to call the "isLowRamDevice()", it will just carry on performing the rest of the checks. So worst case scenario is not being able to detect a low-end phone at this point, and subsequent checks will be made.

    Also it is completely normal that "I see this error in a Lollipop device (Nexus 10) but not in a JellyBean device", because the function has an early return if it detects anything below KitKat. (// Any pre-KitKat device cannot be considered 'low-end')

    0 讨论(0)
提交回复
热议问题