Skip to content

AccessibilityNodeInfoCompat.Checked data type changed from bool to int with 1.17.0 #1309

@BobbyCannon

Description

@BobbyCannon

Android framework version

net9.0-android

Affected platform version

vs2026

Description

We found an issue when upgrading to Xamarin.AndroidX.Core 1.17.0.

The problem is AccessibilityNodeInfoCompat.Checked changed from a bool (v1.16.0.3) to an int (1.17.0).

 IToggleProvider provider = GetProvider();

 if (nodeInfo.Checked.GetType() == typeof(int))
 {
     // Needed for core 1.17+
     //<PackageReference Include="Xamarin.AndroidX.Core" Version="1.17.0" />

     nodeInfo.Checked = (int)? //what to do here?
 }
 else if (nodeInfo.Checked.GetType() == typeof(bool))
 {
     // Works for core < 1.17
     nodeInfo.Checked = provider.ToggleState == ToggleState.On;
 }

Is this expected?

Steps to Reproduce

Upgrade package to the latest 1.17 version.

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions