InputDispatcher: MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
来源:互联网 发布:网络会计兼职 编辑:程序博客网 时间:2024/06/04 23:25
log日志如下:
10-27 22:03:38.190 3338-4531/? I/HwPowerMonitor.PowerExceptionObservable﹕ unhandled onEvent actionID: 300210-27 22:03:38.190 3338-4531/? I/HwPowerMonitor.LogCacheSend﹕ wifi or 3G connected10-27 22:03:38.190 3338-4531/? I/HwPowerMonitor.LogCacheSend﹕ do not need send, lastSendTime: 1445950166380, startTime:1431785366789, currTime: 144595461819910-27 22:03:40.090 26164-26164/? I/Process﹕ Sending signal. PID: 26164 SIG: 910-27 22:03:40.140 2855-3001/? W/InputDispatcher﹕ channel '42998888 com.zhym.myapp/com.zhym.myapp.function.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x910-27 22:03:40.140 2855-3001/? E/InputDispatcher﹕ channel '42998888 com.zhym.myapp/com.zhym.myapp.function.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!10-27 22:03:40.140 2855-3420/? W/InputDispatcher﹕ Attempted to unregister already unregistered input channel '42998888 com.zhym.myapp/com.zhym.myapp.function.MainActivity (server)'10-27 22:03:40.250 6259-6259/? I/wpa_supplicant﹕ wlan0: HEART-BEAT-ACK: 29610-27 22:03:40.410 3300-3311/? W/Binder﹕ Caught a RuntimeException from the binder stub implementation. java.lang.NullPointerException at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280) at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129) at android.os.Binder.execTransact(Binder.java:404) at dalvik.system.NativeStart.run(Native Method)10-27 22:03:40.410 3300-3311/? W/System.err﹕ java.lang.NullPointerException10-27 22:03:40.410 3300-3311/? W/System.err﹕ at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)10-27 22:03:40.410 3300-3311/? W/System.err﹕ at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)10-27 22:03:40.410 3300-3311/? W/System.err﹕ at android.os.Binder.execTransact(Binder.java:404)10-27 22:03:40.410 3300-3311/? W/System.err﹕ at dalvik.system.NativeStart.run(Native Method)10-27 22:03:40.450 2855-2870/? I/ActivityManager﹕ Displayed com.zhym.myapp/.function.MainActivity: +304ms10-27 22:03:46.350 2855-2855/? W/HwScreenOnProximityLock﹕ releaseLock: return because sensor listener is held = false10-27 22:03:46.350 3056-3056/? I/KeyguardFingerprint.Validation﹕ start
相关代码如下:
<pre name="code" class="java">task.getData(new LoadDataFromServer.DataCallback() { @Override public void onDataCallback(JSONObject data) { try { int code = data.getInteger("1");// int code = data.getInteger("code"); if(code == 1) { Toast.makeText(UserInfoActivity.this, "更新成功1...",Toast.LENGTH_SHORT).show(); } else if(code == 2) { Toast.makeText(UserInfoActivity.this, "更新成功2...",Toast.LENGTH_SHORT).show(); } else { Toast.makeText(UserInfoActivity.this, "更新失败!!!...",Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { Toast.makeText(UserInfoActivity.this, "数据解析错误...",Toast.LENGTH_SHORT).show(); e.printStackTrace(); } }// @Override// public void onDataCallback(String returnData) {// String result = returnData;// Log.e("------------UserInfoActivity:updateAvatarInServer:onDataCallback----","--------result="+result+"---------");//// } });
错误原因:在这个回调接口中,参数data是键值形式,它的实际值是(“1”,“1“),而我却用int code = data.getIneger("code")即key="code"来查找其对应的数据,但是实际值中并没有key="code"的这个键。
代码修改:把code换成”1“即可。即换成data中真正存在的键才能找到对应的值。
感悟:出现bug,如果编程环境没问题,那就是程序本身的问题,多把设计的程序的逻辑关系理一理,就能找到问题所在了
0 0
- InputDispatcher: MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- 开发错误记录2 .MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- Android开发错误记录:MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- channel ~ Channel is unrecoverably broken and will be disposed!
- E/InputDispatcher: channel '32d434a4 Toast (server)' ~ Channel is unrecoverably broken and will be d
- Channel is unrecoverably broken and will be disposed!
- Channel is unrecoverably broken and will be disposed!
- Channel is unrecoverably broken and will be disposed!
- Channel is unrecoverably broken and will be disposed!
- Channel is unrecoverably broken and will be disposed!
- Channel is unrecoverably broken and will be disposed
- Channel is unrecoverably broken and will be disposed!
- Android Channel is unrecoverably broken and will be disposed!问题解决
- Android错误:Channel is unrecoverably broken and will be disposed!
- Android Exception 10((server)' ~ Channel is unrecoverably broken and will be disposed!)
- Android 程序报错:Channel is unrecoverably broken and will be disposed!
- Consumer closed input channel or an error occurred/Channel is unrecoverably broken and will be dispo
- channel '537f2e7c com.xxxxx.xxxxx/com.xxxxx.xxxxx.AppActivity (server)' ~ Channel is unrecoverably b
- struts2的execAndWait拦截器使用
- 中国7大套利模式深度解析:套利是金融机构的核心职能
- ORA-01795:列表中的最大表达式数为1000采用分页方式的解决方法
- Material Design 中文版(持续更新)
- Python 类的魔力特性之一:property
- InputDispatcher: MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- Hql语句之uniqueResult()-hql只返回一个结果
- CURL使用示例之数据采集
- wxPython之ImportError: DLL load failed: %1 is not a valid Win32 application.
- LeetCode——Missing Number
- 什么是回调(爱哥出品)
- C++Primer第五版 12.1.1节练习
- Python生成验证码
- Android Bluetooth蓝牙开发(一)