咖啡伴侶

          呆在上海
          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函數(shù)時,插件直接崩潰,并提示:

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

          主站蜘蛛池模板: 皋兰县| 安西县| 城口县| 启东市| 高邮市| 滨海县| 弥勒县| 威海市| 平乡县| 志丹县| 潜山县| 庆城县| 彭阳县| 松江区| 无锡市| 商丘市| 永平县| 巴青县| 浪卡子县| 区。| 辽中县| 阿荣旗| 长岭县| 怀仁县| 邵武市| 乌拉特中旗| 噶尔县| 潮州市| 嘉善县| 乐亭县| 南溪县| 徐汇区| 贡山| 徐闻县| 荆门市| 贵南县| 柘城县| 贺州市| 沙河市| 新乡市| 岐山县|