I have a service class that receives a message. Here is the code -
public void processJSONMessage(String data) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
TextMessage textMessage = objectMapper.readValue(data, TextMessage.class);
textMessageString = textMessage.getMessage();
}
Now I need to send this textMessageString
to MAinActivity
and display a toast message. I want to use the event bus for the same. I have already registered and unregistered the event bus in MAinActivity. But I really dont know how to use the event bus for my example. Can anyone help me please?