Re: [android-developers] how to set mqtt payload to variable

2017-08-03 Thread Marina Cuello
I looked for MqttMessage on Google and it seems like getPayload() gives you a byte array. So if you know that it could be a String that says "connected", you just need to compare the strings. String message = new String(message.getPayload()); if(message.equals("connected")) { // Do stuff } You

[android-developers] how to set mqtt payload to variable

2017-08-02 Thread MOHAMMED ashfaq
hello im new to android development could someone please help me with below code. i want to make if statement from the mqtt payload . how can i make playload = connected then show it is Textview ``` public void messageArrived(String topic, MqttMessage message) throws Exception {