1
我正在构建PubNub Android应用程序。 在这个应用程序,我收到一条消息,但我不知道如何访问它。 例如,如何访问短信?如何解析和检索PubNub邮件对象
这是响应:
hello_world {"text":"this is a sample message"}
更新
private void notifyUser(Object message) {
Message msg = handler.obtainMessage();
try {
final String obj = (String) message;
msg.obj = obj;
handler.sendMessage(msg);
Log.i("Received msg : ", obj.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
请更多代码? –
用更多代码更新。谢谢! –
你想要访问什么?哪里? 从你的代码中,我看到你的notifyUser()方法中有一个传入的参数消息。这是你想读的消息吗?或者它是Message类的一个实例? –