I'm accepting a json from the network, in a service.
It notifies an RxBus of the event:
try {
String m = msg.getData().getString("message");
Log.i("handleMessage", m);
JSONObject message1 = (JSONObject) new JSONTokener(m).nextValue();
if (_rxBus.hasObservers()) {
_rxBus.send(new Events.IncomingMsg(message1));
}
In the subscription side, how do I use that "message1" parameter which is the json i need to manipulate. How do I extract and use the json from the event:
@Override
public void onStart() {
super.onStart();
subscriptions = new CompositeSubscription();
subscriptions//
.add(bindActivity(this, rxBus.toObserverable())//
.subscribe(new Action1<Object>() {
@Override
public void call(Object event) {
if (event instanceof Events.IncomingMsg) {
Log.v(TAG,"RXBUS!!!!");
}
}
}));
}