Using a proxy call for isAttachedToWindow for pre 19 devices
Bug: 17423114
Change-Id: I6f0cc306b7fcc8087b4e4fc92bb8796d51a989d6
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 0648858..8aa013f 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -366,11 +366,7 @@
// This code triggers requestLayout so must be posted outside of the
// layout pass.
public void run() {
- boolean attached = true;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- attached = isAttachedToWindow();
- }
- if (attached) {
+ if (Utilities.isViewAttachedToWindow(AppsCustomizePagedView.this)) {
setDataIsReady();
onDataReady(getMeasuredWidth(), getMeasuredHeight());
}