【问题标题】:Building an Android app, UI goes blank after a second with some BinderProxy error构建一个 Android 应用程序,UI 在一秒钟后变为空白并出现一些 BinderProxy 错误
【发布时间】:2015-06-19 15:23:07
【问题描述】:

从最近几天开始,我一直在构建一个应用程序。我收到这个奇怪的错误,打开应用程序后,整个屏幕变白,我什么也做不了。不过,我正在正常获取日志。似乎整个应用程序运行良好,只是 UI 变为空白,我认为这与我得到的以下日志有关。

04-14 13:09:43.880:I/art(17944):后台部分并发标记扫描 GC 释放 5065(575KB) AllocSpace 对象,13(584KB) LOS 对象,29% 空闲,38MB/54MB,暂停 8.631毫秒总计 49.204 毫秒

04-14 13:09:49.905: I/Timeline(17944): Timeline: Activity_launch_request id:com.packageName time:8607601

04-14 13:09:50.000: A/Home(17944): isFinishing = false

04-14 13:09:50.040: D/Activity(17944): performCreate Call secproduct 特征值false

04-14 13:09:50.040: D/Activity(17944): performCreate 调用调试弹性值true

04-14 13:09:50.150: I/Timeline(17944): Timeline: Activity_idle id: android.os.BinderProxy@a363fd9 time:8607846

04-14 13:09:50.220: V/ActivityThread(17944): updateVisibility : ActivityRecord{3fd6d07f token=android.os.BinderProxy@47236cc {com.packageName/com.packageName.Home}} 显示:false

请帮帮我。在这里发疯。不知道是什么。

其他一些可能有助于你们理解我的问题的事情是:

  1. 我在一个活动中使用 Facebook 登录,只有当我从 Facebook 活动切换到这个活动时才会发生这种情况(大部分情况下)

  2. Activity 正在重新创建导致此错误的自身。

【问题讨论】:

  • 请发布您的代码
  • 在加载应用程序 UI 时是否有您要绑定的服务。
  • 我会发布代码,但我不知道是什么导致了这个问题,所以不确定要发布哪个代码,无法发布整个应用程序。我在此活动中使用 SensorEventListener、Wizrocket 分析和 Quickblox SDK。我认为它就是其中之一。

标签: android user-interface screen visibility


【解决方案1】:
  1. 你有没有正确使用 setContentView 方法来设置布局
  2. 在清单中声明的​​活动
  3. 请检查你的班级,可能有任何对视图或上下文的空引用

【讨论】:

  • 1.是的,如果我不做其他任何事情,它会崩溃,它不会崩溃,只是屏幕变白。
【解决方案2】:
The crash is because the binder you're getting back is an instance of BinderProxy, not your local binder class. This usually happens because your activity is attempting to bind to a service that is not in the same process. When binding across process boundaries, an instance of BinderProxy is used instead of the actual instance (since that's in a different process).

Try this

if(!((Activity) context).isFinishing())
{
    //your code
}

【讨论】:

  • 没有帮助,我什至记录了 isFinishing(),我总是只得到错误,但仍然得到同样的错误。如果有人可以向我解释这到底是做什么的,我也许可以自己调试它。
【解决方案3】:

正如我提到的,我正在使用 SensorEventListener,我也在之前的活动中使用它。在完成导致此错误的活动之前,我没有取消注册监听器。但是感谢大家为我指出正确的方向。

【讨论】:

    猜你喜欢
    • 2016-11-15
    • 2022-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多