Don't forget to add a null check, somehow it can at times return a null and be annoying, but that is my paranoia maybe ^^
version1:
@Override
public void onMessage(Message msg) {
if (msg != null &&
msg.getType() == Message.MessageType.GAME &&
msg.getMessage().contains("Declined trade or what ever it says")) {
// do stuff
}
}
or return on null, depending on what u like:
@Override
public void onMessage(Message msg) {
if (msg == null) {
return;
}
if (msg.getType() == Message.MessageType.GAME &&
msg.getMessage().contains("Declined trade or what ever it says")) {
// do stuff
}
}