Use ViewCompat#isAttachedToWindow to fix FragmentLifecycleTest.
am: 981736d484

Change-Id: I635ca906534b6e8e8ef05afe893b37255ec7815b