Commit 35d9da8
[SnackBar] Fix NPE on Android 8 & 9
It seems like on Android 8 & 9 framework's View implementation has a bug that under certain scenarios if we set a view's visibility when view.getParent() is null, it can cause NPE crash.
Fixes this by switching the order of addView and setVisibility() call.
Resolves #917
PiperOrigin-RevId: 4139783321 parent fcc68a2 commit 35d9da8
File tree
1 file changed
+2
-1
lines changed- lib/java/com/google/android/material/snackbar
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
768 | 770 | | |
769 | 771 | | |
770 | 772 | | |
771 | | - | |
772 | 773 | | |
773 | 774 | | |
774 | 775 | | |
| |||
0 commit comments