Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c46d3e79b2ea8b839358f0215b0a432ef8fad7a2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:23:25 2022
Convert androidx.activity.Cancellable to kotlin
Test: ./gradlew activity:activity:cC
Bug: 257291701
Change-Id: I057f3e54811e7399e40083ef5e3915adc4fa425d
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
https://android-review.googlesource.com/2288554
Branch: androidx-main
commit c46d3e79b2ea8b839358f0215b0a432ef8fad7a2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:23:25 2022
Convert androidx.activity.Cancellable to kotlin
Test: ./gradlew activity:activity:cC
Bug: 257291701
Change-Id: I057f3e54811e7399e40083ef5e3915adc4fa425d
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 7fd8a3206a49baefee8340f0839fcd4de7716788
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:13:23 2022
Rename androidx.activity.Cancellable from .java to .kt
Test: n/a
Bug:257291701
Change-Id: I7f2ff8ce79af41c6437fb9a0f1be90e8990495e8
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
https://android-review.googlesource.com/2288553
Branch: androidx-main
commit 7fd8a3206a49baefee8340f0839fcd4de7716788
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:13:23 2022
Rename androidx.activity.Cancellable from .java to .kt
Test: n/a
Bug:257291701
Change-Id: I7f2ff8ce79af41c6437fb9a0f1be90e8990495e8
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
jb...@google.com <jb...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 4d21e0a45f19ed238ef30756f576930af07449c2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:25:08 2022
Convert ActivityResultCallback to kotlin
Including clean up in test usages of this interface
Test: ./gradlew activity:activity:cC
Bug: 257291701
Relnote: Converted ActvitiyResultCallback to kotlin. Maintains source and binary comptability.
Change-Id: Ifc5e5e1a9a7ed4e281007830fb8d4c74237c63ce
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
https://android-review.googlesource.com/2288334
Branch: androidx-main
commit 4d21e0a45f19ed238ef30756f576930af07449c2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:25:08 2022
Convert ActivityResultCallback to kotlin
Including clean up in test usages of this interface
Test: ./gradlew activity:activity:cC
Bug: 257291701
Relnote: Converted ActvitiyResultCallback to kotlin. Maintains source and binary comptability.
Change-Id: Ifc5e5e1a9a7ed4e281007830fb8d4c74237c63ce
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
Description
Component used: Activity
Version used: 1.7.2
As explained in the Predictive Back guide , you shouldn't use an
OnBackPressedCallback
for non-UI cases (for example, just for logging back). If you add a callback, you have to handle back completely in your callback.That means that calling
remove()
and triggering back viarequireActivity.onBackPressed()
oronBackPressedDispatcher.onBackPressed()
is always an anti-pattern and something that you should not do.It would be helpful if there was a Lint error that specifically catch this case and warn developers ahead of time that this is the wrong thing to do and offer alternatives or at least link to the guide for more information.