Fix issue `Reload banner doesn't disappear after switch on the internet`
The callback `onDismissed` also received for other instances too, just check
visible `snackbar` instance & dismissed `snackbar` instances are same
before releasing the currently visible `snackbar` instance
@@ -74,8 +74,12 @@ public class SnackbarErrorNotification extends ErrorNotification {
@Override
public void onDismissed(Snackbar transientBottomBar, int event) {
super.onDismissed(transientBottomBar, event);
+ // Check if visible snackbar instance & dismissed snackbar instance are same, cuz
+ // receiving `onDismissed` callback for other instances too.
+ if (snackbar == transientBottomBar) {
snackbar = null;
}
+ }
});
// By applying the listener to the button like we have done below, the Snackbar
// doesn't automatically dismiss and we have to manually dismiss it.
