首页 > 其他分享 >子线程Handler.sendMessage 报错:Attempt to invoke virtual method 'boolean android.os.Handler.sendMess

子线程Handler.sendMessage 报错:Attempt to invoke virtual method 'boolean android.os.Handler.sendMess

时间:2022-11-28 16:24:15浏览次数:61  
标签:boolean virtual handler 报错 Handler sendMessage

原因一:检查是否定义handler, 需要定义handler来接受sendMessage 发送的数据,具体代码如下:

private Handler handler;
handler = new Handler() {
            @Override
            public void handleMessage(Message msg) {
            
            }        
}

 

原因二:参考https://blog.csdn.net/Rodulf/article/details/50910356

 

标签:boolean,virtual,handler,报错,Handler,sendMessage
From: https://www.cnblogs.com/yccy/p/16932491.html

相关文章