Why the following public field of the class android.util.DisplayMetrics:
public float noncompatDensity;
is visible in the debugger:
but not available in code?
I'm using Android Studio Bumblebee | 2021.1.1 Patch 3
Why the following public field of the class android.util.DisplayMetrics:
public float noncompatDensity;
is visible in the debugger:
but not available in code?
I'm using Android Studio Bumblebee | 2021.1.1 Patch 3
Copyright © 2021 Jogjafile Inc.


if you look in the source you can see this:
It's annotated with
@hidewhich means the field is not technically part of the SDK. Google uses the @hide annotation to strip out the classes and methods they don't want to be part of the public SDK. That's why your IDE cannot compile your code against them -- they literally don't exist. However, the android framework jar on an actual device DOES contain these classes and methods, which is why they can be accessed at runtime using reflection.