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
warning: [deprecation] removeGlobalOnLayoutListener(OnGlobalLayoutListener) in ViewTreeObserver has been deprecated
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
After some research i came across this solution:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
//noinspection deprecation
mView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
Hi there,
Gradle build indicates this:
warning: [deprecation] removeGlobalOnLayoutListener(OnGlobalLayoutListener) in ViewTreeObserver has been deprecated
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
After some research i came across this solution:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
//noinspection deprecation
mView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
https://developer.android.com/reference/android/view/ViewTreeObserver.html#removeGlobalOnLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener)
Another one I found later is:
MyView.setBackgroundDrawable(viewAlphaOverlay,gd);
Should be turned into:
SetBackground(viewAlphaOverlay,gd);
Thanks!
The text was updated successfully, but these errors were encountered: