WinDeath在notifyDataSetChanged()上 [英] WinDeath on notifyDataSetChanged()

查看:114
本文介绍了WinDeath在notifyDataSetChanged()上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:

data.clear();
data.addAll(datasource.getFilesInFolder());  //gets the data from Sqlite database
adapter.notifyDataSetChanged();

生成此logCat输出:

 12-19 14:34:30.864: W/Binder(986): Caught a RuntimeException from the binder stub implementation.
 12-19 14:34:30.864: W/Binder(986): java.lang.NullPointerException
 12-19 14:34:30.864: W/Binder(986):     at        android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
 12-19 14:34:30.864: W/Binder(986):     at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
 12-19 14:34:30.864: W/Binder(986):     at android.os.Binder.execTransact(Binder.java:404)
 12-19 14:34:30.864: W/Binder(986):     at dalvik.system.NativeStart.run(Native Method)
 12-19 14:34:30.864: W/InputMethodManagerService(757): Got RemoteException sending setActive(false) notification to pid 30040 uid 10174

此异常导致WIN DEATH ...

好吧,我意识到也许是相反的方式,WIN DEATH导致了此日志输出,因为在日志中WINDEATH早于此,所以我不知道为什么会发生风速.

我的适配器是BaseAdapter的扩展,其中没有什么特别的.以下是非常奇怪的:

所提到的代码在自定义侦听器中,该侦听器由另一个类触发.当我将有问题的部分放在听众之外时,它工作得很好.

Caught a RuntimeException from the binder stub implementation是什么意思?数据库有问题吗?还是我的自定义监听器? 任何人都知道出什么事了吗?

解决方案

在执行并发操作时,我已经看到各种问题.例如,参见此线程(文件+服务)和<一个href ="https://stackoverflow.com/questions/3201843/randomly-closing-app-inputmanagerservice-got-remoteexception-sending-setactiv">这一个(从2个线程在画布上绘制).

您正在谈论另一个类中的自定义侦听器,可能是您同时也在做几件事吗?

Hi I have following problem:

data.clear();
data.addAll(datasource.getFilesInFolder());  //gets the data from Sqlite database
adapter.notifyDataSetChanged();

generates this logCat output :

 12-19 14:34:30.864: W/Binder(986): Caught a RuntimeException from the binder stub implementation.
 12-19 14:34:30.864: W/Binder(986): java.lang.NullPointerException
 12-19 14:34:30.864: W/Binder(986):     at        android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
 12-19 14:34:30.864: W/Binder(986):     at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
 12-19 14:34:30.864: W/Binder(986):     at android.os.Binder.execTransact(Binder.java:404)
 12-19 14:34:30.864: W/Binder(986):     at dalvik.system.NativeStart.run(Native Method)
 12-19 14:34:30.864: W/InputMethodManagerService(757): Got RemoteException sending setActive(false) notification to pid 30040 uid 10174

This exception causes WIN DEATH...

Well I realized maybe it is the other way round, WIN DEATH causing this log output, because in log WINDEATH comes before this, then I have no idea why does windeath occur.

My adapter is extended BaseAdapter with nothing really special in it. Very strange is the following :

The mentioned piece of code is inside a custom listener which is triggered from another class. When I put the problematic part outside the listener it works well.

I does the Caught a RuntimeException from the binder stub implementation mean ? Can it be a problem with a database ? or maybe my custom listener ? Anyone has an idea what's wrong ?

解决方案

I have seen various problems that have this issue when doing concurrent actions. See for instance this thread (fling + service) and this one (drawing on canvas from 2 threads).

You are talking about a custom listener in a different class, could it be that you are also doing several things at once?

这篇关于WinDeath在notifyDataSetChanged()上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆