read_message in Bluetooth Chat sample
<p>I'm coding an android app, and it's connected with a CC2540 USB dongle with bluetooth. The procedure is that, when the dongle sends the string "O\r\n" to the phone, the app must view this string on the EditText "Ef". I have changed the Message_Read part in the bluetooth chat sample from Android SDK: </p>

<pre><code> private final Handler mHandler = new Handler() {
    @Override
    public void handleMessage(Message msg) 
    {
        switch (msg.what) 
        {

        case MESSAGE_READ:
            byte[] readBuf = (byte[]) msg.obj;

            if (readBuf.equals("O\r\n"))
            {
                 // construct a string from the valid bytes in the buffer
               String readMessage = new String(readBuf, 0, msg.arg1);
               mConversationArrayAdapter.add(mConnectedDeviceName+":  " + readMessage); 
            }

        }
    }
};
</code></pre>

<p>Is this code okay for my requirements ? </p>

<p>How do i implements the EditText here in this case ? </p>

<p>Thanks in advance </p>
