do not display toast if activity is finishing

This commit is contained in:
Christian Schneppe 2018-11-23 14:31:43 +01:00
parent 37ad10abe5
commit 5f15c12f53

View file

@ -787,11 +787,10 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
private void displayToast(final String msg) {
runOnUiThread(() -> {
try {
Toast.makeText(ConferenceDetailsActivity.this, msg, Toast.LENGTH_SHORT).show();
} catch (WindowManager.BadTokenException e) {
Log.e(Config.LOGTAG,"unable to display toast '"+msg+"'. Activity not running");
if (isFinishing()) {
return;
}
Toast.makeText(ConferenceDetailsActivity.this, msg, Toast.LENGTH_SHORT).show();
});
}