SimpleAdapter不能自动更新 求解释 界面listviewHandlerthreadSimpleAdapter 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 tempAnchor在两个线程里访问,没有做线程同步保护。 这个怎么才能线程保护呢 就算是线程安全 为什么Button 也不能更新呢 谢谢 这个怎么才能线程保护呢 就算是线程安全 为什么Button 也不能更新呢 谢谢这样线程保护:Hashtable<String,myAnchorInfo> temp = (Hashtable<String,myAnchorInfo>)msg.obj;synchronized(temp) { // 访问temp}synchronized(tempAnchor) { // 访问tempAnchro}你做了线程保护的代码是怎么样的?以下这段代码好像也有问题,如果getMyAddress返回null就死循环了。你可以在UI不能更新的时候,在子线程里下几个断点看看能不能执行到。while (true) { try { Thread.sleep(300); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (mobilocAnchor.getMyAddress() != null) { myAnchor = new AnchorInfo(mobilocAnchor.getMyAddress()); break; } } 我已经把问题解决了 消息确实发出去了 甚至UI中的值已经改变了 但是UI不会更新 最后的原因是上面有个强制横屏 的命令 它会阻止UI进行更新 具体什么原理不知道 把他去掉就好了 谢谢楼上的2位 Android 使用ThumbnailUtils获取网络视频缩略图的问题 BaseExpandableList中的childlist的怎么添加onCreateContextMenu事件呢 矩形与线段判断相交算法 关于相机视频录制问题,高手请进,新人学习~~~ sqlite 中查询的问题 [菜鸟求指导]怎样把dataIputStream直接赋给dataOutputStream呢 安卓按钮间隙怎么去掉 device.drag()中的第四个参数 fragment嵌套fragment问题 Android开发的简单问题 在4.4版本上出现加载本地网页显示不全 android蓝牙
就算是线程安全 为什么Button 也不能更新呢 谢谢
就算是线程安全 为什么Button 也不能更新呢 谢谢
这样线程保护:Hashtable<String,myAnchorInfo> temp = (Hashtable<String,myAnchorInfo>)msg.obj;
synchronized(temp) {
// 访问temp
}synchronized(tempAnchor) {
// 访问tempAnchro
}你做了线程保护的代码是怎么样的?以下这段代码好像也有问题,如果getMyAddress返回null就死循环了。你可以在UI不能更新的时候,在子线程里下几个断点看看能不能执行到。while (true) {
try {
Thread.sleep(300);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (mobilocAnchor.getMyAddress() != null) {
myAnchor = new AnchorInfo(mobilocAnchor.getMyAddress());
break;
}
}
最后的原因是上面有个强制横屏 的命令 它会阻止UI进行更新 具体什么原理不知道 把他去掉就好了
谢谢楼上的2位