`

android Can't create handler inside thread that has not called Looper.prepare()

阅读更多

在做从网络获取数据加载进度条的时候,总总出现

android Can't create handler inside thread that has not called Looper.prepare()这个错误。在仔细检查和询问
了网友之后才发现是由于声明ArrayList<HashMap<String,String>>没有new的原因。以后记住了,呵呵。还有绑定
SimpleAdapter不能直接放在线程中,那读取数据的list直接调用方法即可:
如:
adapter = new SimpleAdapter(this,HttpUtils.getPagesData(typeid), R.layout.yellowdetail_item,  
new String[]{"image","info_name","info_tel"}, new int[]{R.id.imageinfotype,R.id.infoname,R.id.infotel});  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics