咖啡伴侶

          呆在上海
          posts - 163, comments - 156, trackbacks - 0, articles - 2

          導航

          公告

          呆在上海 

          Java,Flex,Android,SVG等技術的 圖形UI

          Email:leooath@gmail.com

          QQ:35339893


          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          遇到的情況
          AsyncTask
          protected GAViewer doInBackground(Activity... params) {
              ......
              GAViewer viewer = new GAViewer(result, drawActivity.getApplicationContext());
              return viewer;
          }

          產生
          Can't create handler inside thread that has not called Looper.prepare()
          異常

          原因估計
          1.viewer 是個 SurfaceView ,而doInBackground是不允許操作UI的
          2.drawActivity.getApplicationContext() 已經操作了UI ?maybe

          Feedback

          # re: Can't create handler inside thread that has not called Looper.prepare() 異常問題[未登錄]  回復  更多評論   

          2011-11-28 20:06 by mark
          android webkit plugin

          線程里回調javascript函數時,插件直接崩潰,并提示:

          WARN/System.err(296): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
          原因是,另外一線程不能更新UI主線程。插件提供同步函數。用這個pluginthreadasynccall,再調用invokeDefault就可以了。

          主站蜘蛛池模板: 荥阳市| 梨树县| 修水县| 萨迦县| 察雅县| 婺源县| 南郑县| 通榆县| 宜宾市| 大同市| 泰来县| 建德市| 安阳市| 濮阳市| 三亚市| 和平区| 合阳县| 乡城县| 新郑市| 长宁区| 乌恰县| 拜城县| 麻城市| 许昌市| 原平市| 乌鲁木齐县| 河曲县| 淳化县| 郸城县| 麦盖提县| 凤台县| 和平县| 邢台县| 周口市| 嘉义市| 涿鹿县| 五常市| 射阳县| 徐州市| 德化县| 嘉定区|