Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d4a10887446c67c3e706234a9e8dcce9ee36d193
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Wed Mar 18 16:23:22 2020
Setup ViewTreeLifecycleOwner for AppCompatActivity
bug: 151603528
Test: AppCompatActivityViewTreeLifecycleTest
Change-Id: I8eff85ba72a6782c1e4249ebd2f949cbba271e34
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatActivityViewTreeLifecycleTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
https://android-review.googlesource.com/1261719
Branch: androidx-master-dev
commit d4a10887446c67c3e706234a9e8dcce9ee36d193
Author: Sergey Vasilinets <sergeyv@google.com>
Date: Wed Mar 18 16:23:22 2020
Setup ViewTreeLifecycleOwner for AppCompatActivity
bug: 151603528
Test: AppCompatActivityViewTreeLifecycleTest
Change-Id: I8eff85ba72a6782c1e4249ebd2f949cbba271e34
M appcompat/appcompat/build.gradle
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatActivityViewTreeLifecycleTest.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
se...@google.com <se...@google.com> #3
se...@google.com <se...@google.com> #4
Change was temporarily reverted to allow appcompat to go beta, it will applied again later for 1.3.0-alpha01 release.
se...@google.com <se...@google.com>
il...@google.com <il...@google.com> #5
This has been
Description
- Version used: 2.3.0-alpha01
`AppCompatActivity` reimplements `setContentView` and it doesn't call it's super. For this reason the code inside `ComponentActivity.setContentView` is not executed. And for this reason `ViewTreeLifecycleOwner.get(View)` always returns `null`. If my Activity extends from `ComponentActivity` all works like a charm.
To reproduce just create an `AppCompatActivity` with a view get the view with findViewById and call `ViewTreeLifecycleOwner.get` with it.