I want to open a Toast, but it doesn"t seem to work in a listener (of Smack), like this example:
private ChatManagerListener chatManagerListener = new ChatManagerListener() {
public void chatCreated(Chat newChat, boolean createdLocally) {
if(!createdLocally) {
Toast.makeText(mCtx, "CHAT CREATED", Toast.LENGTH_SHORT).show();
// do some stuff
}
}
};
If I use the Toast-code somewhere else in the class, it works, as long as it isn't a listener.
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(Activity.this, "import finished", Toast.LENGTH_SHORT).show();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With