Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] NPE @ MqttAndroidClient.subscribe ()

Hi ,

I am using Paho Android Service jar. In my Main Activity on onClick event of button, I have implemented following steps:

Created Android Client, set the callback and options
Android client connect method
waitforCompletion on token from connect()
subscribe() on the same client.

getting NPE on MqttAndroidClient.subscribe() when dont have waitforCompletion call between connect and subscribe.

try {
client.connect(options, null, callback);
client.subscribe(topic,qos);
} catch (MqttException e) {
e.getCause();
}

Could not figure out what exactly is going wrong. Can someone please help on this issue ?

thanks
-- 
Ravi Prakash Lakhotia


Back to the top