Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/TerminalView.java @ 417:4dcc071e1feb
monitor failure should not kill the TE
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 29 Oct 2014 12:12:48 -0700 |
parents | e3b83c4f02f1 |
children | 9045b1af94e5 |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/TerminalView.java Mon Oct 27 13:58:42 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/TerminalView.java Wed Oct 29 12:12:48 2014 -0700 @@ -72,7 +72,6 @@ private Matrix scaleMatrix; private static final Matrix.ScaleToFit scaleType = Matrix.ScaleToFit.FILL; - private Toast notification = null; private String lastNotification = null; private volatile boolean notifications = true; @@ -242,22 +241,11 @@ } public void notifyUser(String message) { - if (!notifications) - return; - - if (notification != null) { - // Don't keep telling the user the same thing. - if (lastNotification != null && lastNotification.equals(message)) - return; - - notification.setText(message); - notification.show(); - } - else { - notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); - notification.show(); - } - + if (!notifications) return; + // Don't keep telling the user the same thing. + if (lastNotification != null && lastNotification.equals(message)) return; + Toast notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); + notification.show(); lastNotification = message; }