You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On ViewTreeObserver.OnPreDrawListener.onPreDraw getContext() doesn't return an Activity but a ContextThemeWrapper. Activity extends ContextThemeWrapper. In my app I use only one activity and then handle fragments through back stack.
At line 194 View decor = ((Activity) getContext()).getWindow().getDecorView(); an exception is being thrown java.lang.ClassCastException: android.support.v7.view.ContextThemeWrapper cannot be cast to android.app.Activity.
It seems more appropriate to replace it with this View decor = ((Activity) ((ContextThemeWrapper) getContext()).getBaseContext()).getWindow().getDecorView();
The text was updated successfully, but these errors were encountered:
On ViewTreeObserver.OnPreDrawListener.onPreDraw
getContext()
doesn't return an Activity but a ContextThemeWrapper. Activity extends ContextThemeWrapper. In my app I use only one activity and then handle fragments through back stack.At line 194
View decor = ((Activity) getContext()).getWindow().getDecorView();
an exception is being thrown java.lang.ClassCastException: android.support.v7.view.ContextThemeWrapper cannot be cast to android.app.Activity.It seems more appropriate to replace it with this
View decor = ((Activity) ((ContextThemeWrapper) getContext()).getBaseContext()).getWindow().getDecorView();
The text was updated successfully, but these errors were encountered: