Skip to content

ActivityResultContracts.CreateDocument class implementation error still exists #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
josago97 opened this issue May 15, 2022 · 2 comments · Fixed by #560
Closed

ActivityResultContracts.CreateDocument class implementation error still exists #551

josago97 opened this issue May 15, 2022 · 2 comments · Fixed by #560

Comments

@josago97
Copy link

Version Information

  • Visual Studio version: 17.2.0
  • Xamarin.Android version: 12.3.0.3
  • Using AndroidX or Support Libraries:
  • Xamarin.AndroidX.AppCompat: 1.4.1.1
  • Xamarin.AndroidX.SwipeRefreshLayout: 1.1.0.8
  • Xamarin.Essentials: 1.7.3
  • Xamarin.Google.Android.Material: 1.6.0

Describe your Issue:

Hi, in March I reported this error (#504), supposedly I have updated the libraries to the latest version and the error still exists.

@jpobst
Copy link
Contributor

jpobst commented May 24, 2022

There hadn't been a new version of this package released since the fix was committed. We've released a new version that should have the fix:

https://www.nuget.org/packages/Xamarin.AndroidX.Activity/1.4.0.3

@tipa
Copy link

tipa commented Nov 24, 2023

@moljac @jpobst this problem still exists, but with ActivityResultContracts.GetContent (and like even more, which I didn't test)

public class MyGetContent : AndroidX.Activity.Result.Contract.ActivityResultContracts.GetContent
{
    public override Intent CreateIntent(Context context, Java.Lang.Object input)
    {
        return base.CreateIntent(context, input);
    }
}

name clash: createIntent(Context,Object) in MyGetContent and createIntent(Context,String) in ActivityResultContract have the same erasure, yet neither overrides the other public android.content.Intent createIntent (android.content.Context p0, java.lang.Object p1)

Should I open a new issue for it?

Also, is it possible to use the correct types for the Contract classes? E.g. GetContent should take a string when using ActivityResultLauncher.launch() and return a Uri in the OnActivityResult callback. I guess using generics isn't as easy in bindings...

https://android.googlesource.com/platform/frameworks/support/+/androidx-master-release/activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java#420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants