You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently upgraded Xamarin.AndroidX.AppCompat from 1.2.0.6 to 1.2.0.7
and Xamarin.AndroidX.Fragment from 1.2.5.4 to 1.3.0.1
This resulted in warnings re StartActivityForResult being deprecated in some of my Fragments. Then I noticed in my MainActivity (single Activity app) that there was one that didn't have a warning. This seems inconsistent, so I'm asking if that is expected and just a difference between Activity and Fragment or should it also be marked as obsolete/deprecated in Activity.
I reworked my code in the MainActivty to use the new ActivityResultLauncher and that worked ok. However, the IActivityResultCallback results in public void OnActivityResult(Java.Lang.Object p0) which leads to some pretty ugly code having to test and cast the p0 to whatever is needed before you can use it. The old way was at least readable!! The fragments now all use the new ActivityResultLauncher so they are ok as well.
I then tried a couple of variations of the other types of ActivtyResultContracts as tests in a test project. Some worked, some didn't. GetContent() works, but TakePicture() wouldn't return a bitmap. I think that is because of what was raised in Issue #288.
The text was updated successfully, but these errors were encountered:
This is still an issue 3 months later, the bindings need to be updated so that we don't have to use Java.Lang.Object p0 as a parameter on OnActivityResult. Casting isn't really a good solution
VS 16.10.0 P1.0
I recently upgraded Xamarin.AndroidX.AppCompat from 1.2.0.6 to 1.2.0.7
and Xamarin.AndroidX.Fragment from 1.2.5.4 to 1.3.0.1
This resulted in warnings re StartActivityForResult being deprecated in some of my Fragments. Then I noticed in my MainActivity (single Activity app) that there was one that didn't have a warning. This seems inconsistent, so I'm asking if that is expected and just a difference between Activity and Fragment or should it also be marked as obsolete/deprecated in Activity.
I reworked my code in the MainActivty to use the new ActivityResultLauncher and that worked ok. However, the IActivityResultCallback results in public void OnActivityResult(Java.Lang.Object p0) which leads to some pretty ugly code having to test and cast the p0 to whatever is needed before you can use it. The old way was at least readable!! The fragments now all use the new ActivityResultLauncher so they are ok as well.
I then tried a couple of variations of the other types of ActivtyResultContracts as tests in a test project. Some worked, some didn't. GetContent() works, but TakePicture() wouldn't return a bitmap. I think that is because of what was raised in Issue #288.
The text was updated successfully, but these errors were encountered: