-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error messages remain after closing app, obscuring other apps #233
Comments
So... This is actually not a bug. Apparently for toasts, they're made for system messages (phone-wide)... hence if you exit and stuff, the toast messages show up through the whole phone. The solution? We should use a SnackBar instead of the toast! Here is the code below: /**
* General way to make a snackbar
*
* @since 46
* @param string - the string to add to on the
* @param showLength - how long to show the snackbar
*/
private void makeSnackbar(String string, int showLength) {
if(string != null && string.length() > 0) {
Snackbar.make(mainLayout,
string, showLength
).show();
}
} So then, if you have this sort of code, why not abide by Material Design and show these errors in a Snackbar? Contrary to what the Snackbar documentation says... Snackbars are not transient at all........ There is a bug that exactly explains the issue. http://stackoverflow.com/questions/33264764/when-is-snackbar-isqueued-used-how-to-queue-the-snackbar In other words, the Snackbar seems to be bugged...... Solutions that I -- someone who can't deal with UI well -- can think of:
@VincentIII - what do you think T_T I'll make a task for Snackbars at some point. |
Please star... assuming this is a real issue: https://code.google.com/p/android/issues/detail?id=193752&thanks=193752&ts=1447177236 |
The core issue still exists, but as of 6.4rc all toasts are LENGTH_SHORT which should mitigate this somewhat. |
I talked to @TheAndroidMaster about this, and we seem to have some sort of plan to go forward for this. He'll be working on changing toasts to snackbars. He told me that the snackbars should just close and then open a new one instead of stacking on each other so he'll investigate why our snackbars aren't doing that. |
This is mostly fixed with pull request #284. The issue here was that the Snackbars were being attached to a DrawerLayout instead of a CoordinatorLayout. I've added one to temporarily contain the fragment, this will probably be used for later improvements as well if we want to define the action bar in the layout file or something. There is a small issue that snackbars made from the nav drawer aren't visible, but we were thinking of replacing it anyway so it shouldn't matter. Otherwise, we could always just replace the calls in the navigation drawer with toasts. |
Steps to reproduce: select several buses that will give an error, then immediately close the app or switch to another app before all messages have appeared on screen.
What happens: error messages remain on screen, obscuring other apps.
What should happen: error messages disappear immediately.
The text was updated successfully, but these errors were encountered: