android can't create handler inside thread that has not called Looper.prepare()解决方案

安卓不能在线程中操作ui 所以我在线程中操作UI时候就会报错

后来发现在操作ui那个前后加上Looper.prepare();  Looper.loop();

eg:

Looper.prepare(); 
Toast.makeText(CloseComputerActivity.this, "22222222222!", Toast.LENGTH_LONG)
.show();
Looper.loop();


然后问题解决

你可能感兴趣的:(android can't create handler inside thread that has not called Looper.prepare()解决方案)