咖啡伴侶

          呆在上海
          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就可以了。

          主站蜘蛛池模板: 桦甸市| 财经| 和顺县| 顺义区| 芜湖县| 民和| 隆尧县| 永和县| 卢湾区| 大安市| 林周县| 正阳县| 吴江市| 裕民县| 兰考县| 苏尼特左旗| 河间市| 巫溪县| 克拉玛依市| 台东市| 余姚市| 沅江市| 隆子县| 四子王旗| 开江县| 江川县| 肃宁县| 新巴尔虎右旗| 临西县| 外汇| 兴海县| 会泽县| 浦县| 华宁县| 枝江市| 铜鼓县| 淮南市| 玉田县| 东兴市| 克什克腾旗| 陈巴尔虎旗|