I was digging in sources of Android by looking for an answer of how system recognizes @null keyword that mentioned in a layout. For instance,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@null"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
So far I followed this route:
I tried to find in source code of JNI implementation of AssetManager loadResourceValue method, but I have not succeeded.
I would appreciate if anyone can point out how Android resolves @null tag.
Thanks in advance!
You were searching in AssetManager
frontend that is exposed via NDK. There are no JNI functions at all. JNI wrapper for android.util.AssetManager
is here.
ResTable
class is used for actual parsing and resolving. If you dig a bit deeper - you can find lines where @null
is handled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With