Skip to content

Why is Android.Runtime.JavaObject internal? #10157

@cyraid

Description

@cyraid

Android framework version

net9.0-android

Affected platform version

VS 2022

Description

So I get an item from AdapterView using GetItemAtPosition and I get a JavaObject with an instance field in there that I need but I cannot access unless with Reflection as per some Stackoverflow posts on how to get the C# instance object out of a JavaObject. Why is this not available to us? Could someone make it available? :)

Steps to Reproduce

  1. Make new Android Project
  2. Use ListView
  3. Have an ArrayAdapter (for example)
  4. Use a class that is not Java.Lang.Object for the items in ArrayAdapter.
  5. Add an Item Click
  6. Try using AdapterView to GetItemAtPosition and be surprised that you can only get a Java.Lang.Object without being able to access the instance.

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementProposed change to current functionality.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions