Bug 1236232 - Only use root layout as snackbar parent if it exists (Webapps). r=mcomella
--- a/mobile/android/base/java/org/mozilla/gecko/SnackbarHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/SnackbarHelper.java
@@ -127,14 +127,17 @@ public class SnackbarHelper {
}
/**
* Find the best parent view to hold the Snackbar's view. The Snackbar implementation of the support
* library will use this view to walk up the view tree to find an actual suitable parent (if needed).
*/
private static View findBestParentView(Activity activity) {
if (activity instanceof GeckoApp) {
- return activity.findViewById(R.id.root_layout);
+ final View view = activity.findViewById(R.id.root_layout);
+ if (view != null) {
+ return view;
+ }
}
return activity.findViewById(android.R.id.content);
}
}