Error in Handler.obtainMessage

Asked

Viewed 39 times

0

I’m developing an app that uses Bluetooth connection, but I’m encountering a problem that I can’t solve. I am following the orientation of this link to such https://developer.android.com/guide/top ... Tooth.html. Follow the code below:

Handler.obtainMessage(MESSAGE_READ, bytes, -1, buffer).sendToTarget();

The word "Handler" and "MESSAGE_READ" is giving error and do not know how to do, someone could help me?

  • Post the error message if it is not difficult to know the problem

  • Message_read is a constant.. It should probably be stated in your class, Ehandler you have to create the instance before. Ex: Handler mHandler = new Handler() and implement Handler and make the call with mHandler.obtainMessage(...)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.