Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Please include a sample project that reproduces your issue.
ap...@google.com <ap...@google.com> #3
Sample project linked here:
il...@google.com <il...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e3ae9332249aad7636d3050afb3278ada0199fad
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 15:49:25 2020
Ensure ActivityResult lint works with newer lint versions
Previously the lint rule only worked for version 26.3.0 of lint since it
used API that had been deleted in later versions. We have a problem
where we need to be able to on older versions, but should also support
newer versions.
This changes use reflection to access the APIs from version 26.3.0 and
27.1.0, which means the rule should now work no matter what version of
lint.
Test: added tests for 27.1.0, tested in app for 26.3.0
Bug: 162155191
Change-Id: I732ca50aa629fc8a0c2df4c183f363e4a286c490
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
https://android-review.googlesource.com/1380294
Branch: androidx-master-dev
commit e3ae9332249aad7636d3050afb3278ada0199fad
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 15:49:25 2020
Ensure ActivityResult lint works with newer lint versions
Previously the lint rule only worked for version 26.3.0 of lint since it
used API that had been deleted in later versions. We have a problem
where we need to be able to on older versions, but should also support
newer versions.
This changes use reflection to access the APIs from version 26.3.0 and
27.1.0, which means the rule should now work no matter what version of
lint.
Test: added tests for 27.1.0, tested in app for 26.3.0
Bug: 162155191
Change-Id: I732ca50aa629fc8a0c2df4c183f363e4a286c490
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
Description
Component used: Lifecycle
Version used: 2.5.0-alpha01
Currently the call to
enableSavedStateHandles()
creates aViewModel
using theViewModelStore
. This requires that the ViewModelStore be set on any component attempting to make the call, but there are scenarios where the call toenableSavedStateHandles
needs to happen before that in particular in the Fragment and Navigation components where the call is not immediately made when the object is constructed or sometimes not at all.If we remove the reliance on
SavedStateHandles
(and therefore view models), we can lean into theSavedStateProvider
APIs and the call toenableSavedStateHandles()
can be made before theViewModelStore
is set.