Can't create handler inside thread that has not called Looper.prepare()

前端 未结 6 1723
我寻月下人不归
我寻月下人不归 2020-12-03 16:50

I get this error \"Can\'t create handler inside thread that has not called Looper.prepare()\"

Can you tell me how to fix it?

public class PaymentAc         


        
6条回答
  •  一整个雨季
    2020-12-03 17:36

    I assume you create a Handler in startPayment() method. You can't do that, as handlers can be created on th UI thread only. Just create it in your activity class.

提交回复
热议问题