咖啡伴侶

          呆在上海
          posts - 163, comments - 156, trackbacks - 0, articles - 2
          遇到的情況
          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就可以了。

          主站蜘蛛池模板: 娱乐| 德保县| 时尚| 青浦区| 和政县| 德令哈市| 荆门市| 金平| 广灵县| 磐安县| 万年县| 光山县| 济宁市| 轮台县| 桑日县| 小金县| 陇西县| 白朗县| 夏河县| 扶沟县| 祥云县| 灵璧县| 离岛区| 陆川县| 庆安县| 建水县| 开原市| 吉隆县| 扬中市| 旬阳县| 耿马| 西峡县| 聂荣县| 浙江省| 河源市| 万盛区| 和平区| 旅游| 固安县| 凤阳县| 抚松县|