java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
2013-09-16 09:13
507 查看
Looper.prepare(); //开头 Builder builder = new Builder(MyBurglarService.this); //这里我的MyBurglarService是我的一个线程 /*在这设置builder的属性*/ AlerDialog dialog = builder.create(); //属性设置完后创建 dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); //设置该dialog为全局性的对话框,即在任何时候都弹出的对话框 dialog.show(); //弹出 Looper.loop(); //结尾
线程开头加个Looper.prepare();
线程结束加个Looper.loop();
相关文章推荐
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException:Can‘t create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- Android java.lang.RuntimeException: Can\'t create handler inside thread that has not called Looper.prepare()
- 线程 java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepa
- android java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.pr
- java.lang.RuntimeException:Can't create handler inside trhead that has not called Looper.prepare
- Android 异常 java.lang.RuntimeException: Can't create handler inside thread that has not called Looper
- Android java.lang.RuntimeException: Can't create handler inside thread that has not called
- java.lang.RuntimeException: Can't create handler inside thread that has not
- java.lang.RuntimeException: Can't create handler inside thread that has not
- java.lang.RuntimeException: Can't create handler inside thread that has not