dotnet / android-libraries

.NET for Android bindings for Google's libraries, such as AndroidX, GooglePlayServices, Firebase, and MLKit and their 3rd party dependency libraries.
MIT License
233 stars 50 forks source link

ActivityResultContracts.CreateDocument class implementation error still exists #551

Closed josago97 closed 2 years ago

josago97 commented 2 years ago

Version Information

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 commented 2 years ago

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 commented 1 year ago

@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