diff --git a/library/src/main/java/com/github/javiersantos/appupdater/UtilsDisplay.java b/library/src/main/java/com/github/javiersantos/appupdater/UtilsDisplay.java index ff280b83..c1f24f87 100644 --- a/library/src/main/java/com/github/javiersantos/appupdater/UtilsDisplay.java +++ b/library/src/main/java/com/github/javiersantos/appupdater/UtilsDisplay.java @@ -58,7 +58,7 @@ static void showUpdateAvailableSnackbar(final Context context, String content, B snackbarTime = Snackbar.LENGTH_LONG; }*/ - Snackbar snackbar = Snackbar.make(activity.getWindow().getDecorView().getRootView(), content, snackbarTime); + Snackbar snackbar = Snackbar.make(activity.findViewById(android.R.id.content), content, snackbarTime); snackbar.setAction(context.getResources().getString(R.string.appupdater_btn_update), new View.OnClickListener() { @Override public void onClick(View view) { @@ -78,7 +78,7 @@ static void showUpdateNotAvailableSnackbar(final Context context, String content }*/ - Snackbar.make(activity.getWindow().getDecorView().getRootView(), content, snackbarTime).show(); + Snackbar.make(activity.findViewById(android.R.id.content), content, snackbarTime).show(); } static void showUpdateAvailableNotification(Context context, String title, String content, UpdateFrom updateFrom, URL apk, int smallIconResourceId) {