diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-11-23 14:31:43 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-11-23 14:31:43 +0100 |
commit | 5f15c12f533c4a7b1b5a808516598adf518ec504 (patch) | |
tree | 52c505977efbe8639d12903440cb38578f57005c | |
parent | 37ad10abe5d170e72e853b8d18dbfb32b2bad84a (diff) |
do not display toast if activity is finishing
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 91b6cb698..c7f35f3b8 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -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(); }); } |