Null Views and NPE when dealing with fragments
avsector opened this issue · comments
The validity of a view reference should be checked before attempting to show the SnackBar. When using SnackBar and suppling the view in the builder for the fragments, there's a slight chance that when the SnackBar is building the view is no longer available, hence causing a NullPointerException.
An easy way to produce this is showing SnackBar in asynchronous callbacks in the fragments. Simply start an asynchronous job and navigate away from the fragment.