Status Update
Comments
il...@google.com <il...@google.com> #2
Branch: androidx-master-dev
commit d46999fa005b4726287814ea0f8abe30cf189a01
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 26 15:36:06 2020
Clean up ActivityResultCaller implementation
Instead of using two separate anonymous classes to be returned by the
register methods, lets clean it up by using an internal class and only
doing the implementation once.
Test: Tested in app
Bug: 156875743
Change-Id: Ia63dd0dce4ecd7115ea93168f889e119738e3352
M activity/activity-ktx/api/1.2.0-alpha06.txt
M activity/activity-ktx/api/current.txt
M activity/activity-ktx/api/public_plus_experimental_1.2.0-alpha06.txt
M activity/activity-ktx/api/public_plus_experimental_current.txt
M activity/activity-ktx/api/restricted_1.2.0-alpha06.txt
M activity/activity-ktx/api/restricted_current.txt
M activity/activity-ktx/src/main/java/androidx/activity/result/ActivityResultCaller.kt
vs...@gmail.com <vs...@gmail.com> #3
Branch: androidx-master-dev
commit 55c784def8b9942026075af6fc659b551732ef44
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue May 26 08:45:51 2020
Add getContract to ActivityResultLauncher
Intents provide a way to check if the intent can be handled by any
Activity components and the ActivityResultLauncher should provide
the ability to do something similar.
This change adds a getContract API to ActivityResultLauncher that gives
the returns the contract used to register the launcher. This means that
users can create an Intent from their contract and make all of their
desired checks.
Test: ActivityResultLauncherTest
Bug: 156875743
RelNote: "ActivityResultLauncher now allows you to get the
ActivityResultContract that was used to register the launcher."
Change-Id: I64f536f2b3dde3e87cea884c6b9c111e5efe26ed
M activity/activity-ktx/build.gradle
M activity/activity-ktx/src/androidTest/AndroidManifest.xml
A activity/activity-ktx/src/androidTest/java/androidx/activity/result/ActivityResultCallerTest.kt
M activity/activity-ktx/src/main/java/androidx/activity/result/ActivityResultCaller.kt
M activity/activity/api/1.2.0-alpha06.txt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_1.2.0-alpha06.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_1.2.0-alpha06.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultLauncherTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultLauncher.java
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
il...@google.com <il...@google.com>
jd...@gmail.com <jd...@gmail.com> #4
This has been fixed internally and will be available in the Activity 1.2.0-alpha06 release.
To address this the ActivityResultLauncher
now gives access to the ActivityResultContract
.
With the contract, you can create the intent and use it to call resolveActivity()
directly:
launcher.contract.createIntent(context, input).resolveActivity(packageManager)
zh...@google.com <zh...@google.com> #5
Keep in mind that due to the resolveActivity()
will return null unless you add the specific <queries>
elements to your manifest.
As per that doc, the alternative is to catch the ActivityNotFoundException
yourself by wrapping your launch()
call in a try
/ catch
, just like if you were using startActivityForResult()
yourself.
zh...@google.com <zh...@google.com> #6
Oh, if the intention here is to simply report an issue for all non-stable versions (which will have a different string length) to avoid pulling in a full semver implementation, I think we just need to flip the comparison in else -> this < other
here to fix this for stable versions.
jd...@gmail.com <jd...@gmail.com> #7
Flipping it would work for a quick fix, but the length check may still end up returning incorrect data if the patch version of fragment ever reached 2 digits, 1.3.10.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 2db691788fe04d6cb2080cd2187989962a2c2b46
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 10 15:18:15 2021
Fix string comparision for activity lint
Fixing error that caused lint report when using Fragment versions
greater than 1.3.0.
RelNote: "There is no longer a false positive lint error when using
Fragment version 1.3.1 with Activity Result APIs"
Test: ActivityResultFragmentVersionDetectorTest
Bug: 182388985
Change-Id: I54da158c0ca4bfa6246f51226fd4991dc485b0d2
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
jb...@google.com <jb...@google.com> #9
This has been fixed internally and will be available in the next Activity release.
vs...@gmail.com <vs...@gmail.com> #10
Awesome, thank you!
ba...@gmail.com <ba...@gmail.com> #11
to...@yahoo.com <to...@yahoo.com> #12
[Deleted User] <[Deleted User]> #13
ce...@gmail.com <ce...@gmail.com> #14
Release notes of
We still get it with Activity 1.2.2 and Fragment 1.3.2.
to...@yahoo.com <to...@yahoo.com> #15
implementation 'androidx.fragment:fragment:1.3.2'
finally seems to work...
ce...@gmail.com <ce...@gmail.com> #16
Edit for
The issue is fixed.
I'm sorry for the previous message, the issue was caused by the dependency configuration of our project (some modules had a transitive dependency on previous activity/fragment versions).
lb...@gmail.com <lb...@gmail.com> #17
il...@google.com <il...@google.com> #18
Upgrading to Activity 1.2.2 (or Activity 1.3.0-alpha05, which also includes the fix) is the only requirement.
Fragment 1.3.2 includes a dependency on Activity 1.2.2, so upgrading your version of Fragments will also pull in the fix via the transitive dependency.
lb...@gmail.com <lb...@gmail.com> #19
implementation "androidx.fragment:fragment-ktx:1.3.2"
?
But how do you guys know this fixed the issue?
lb...@gmail.com <lb...@gmail.com> #21
ca...@gmail.com <ca...@gmail.com> #22
```
Update to Fragment 1.3.0 to use ActivityResult APIs
```
il...@google.com <il...@google.com> #23
Re #22 - please file a new bug with a sample project that reproduces your issue.
ar...@gmail.com <ar...@gmail.com> #24
ar...@gmail.com <ar...@gmail.com> #25
ar...@gmail.com <ar...@gmail.com> #26
du...@gmail.com <du...@gmail.com> #27
il...@google.com <il...@google.com> #28
Re #24-27 - please file a new issue with a project that reproduces your issue.
mu...@gmail.com <mu...@gmail.com> #29
mu...@gmail.com <mu...@gmail.com> #30
ig...@gmail.com <ig...@gmail.com> #31
implementation "androidx.activity:activity-ktx:
implementation "androidx.fragment:fragment-ktx:1.3.4"
il...@google.com <il...@google.com> #32
Re #29, #31 - like previously mentioned, file a new issue with a project that reproduces your issue.
si...@gmail.com <si...@gmail.com> #33
df...@smart-soft.com <df...@smart-soft.com> #34
il...@google.com <il...@google.com> #35
Re
Description
Component used: Activity
Version used: 1.3.0-alpha04
InvalidFragmentVersionForActivityResult
is reported though I forcedandroidx.fragment:fragment-ktx:1.3.1
.Here is my build.gradle essentials: