I am using the bluetooth chat example and i have the following problem..
When i add an if statement inside handler it always return false..
case MESSAGE_READ:
byte[] readBuf = (byte[]) msg.obj;
String stringMsg = new String(readBuf);
if ( stringMsg == "a"){
Log.i(tag,"x RECEIVED OK...");
}
break;
When i debug the program i get:
stringMsg = {java.lang.String@830020784928}"a��������....."
value = {char[1364]830020788104}
[0] = 'a' 97
[1] = '\u0000' 0
[2] = '\u0000' 0
[3] = '\u0000' 0
[4] = '\u0000' 0
[5] = '\u0000' 0
[6] = '\u0000' 0
...
...
...
...
...
hashCode = 0
offset = 0
count = 1024
Can you please help me to read the inputstream save the Character as a string(stringMsg) and be able to use an if statement to check its content ?
Thank you in advance..!