nowinandroid
nowinandroid copied to clipboard
Handle `ActivityNotFoundException` when launching Chrome custom tab
I think we have the same issue with the default LocalUriHandler:
https://github.com/android/nowinandroid/blob/a5c030f74048897256f2c2f8fb29f0a2e8222d60/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt#L260 https://github.com/android/nowinandroid/blob/a5c030f74048897256f2c2f8fb29f0a2e8222d60/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt#L262 https://github.com/android/nowinandroid/blob/a5c030f74048897256f2c2f8fb29f0a2e8222d60/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt#L275 https://github.com/android/nowinandroid/blob/a5c030f74048897256f2c2f8fb29f0a2e8222d60/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt#L280
And we probably should use a more generic message for these.
After discussion with the team, we decided that this is a good opportunity to introduce a general error handler which displays errors using a SnackBar one after each other (following the Material guidelines).
Additionally, we may want to consider having a persistent "you're offline" bar (similar to Spotify) which would avoid the contention for Snackbars between the offline Snackbar and other messages.
I'm going to close this as having a Toast isn't aligned with our material guidelines. Have filed https://github.com/android/nowinandroid/issues/1435 in case anyone from the community wants to pick up the implementation of a better solution.