3alto
3alto

Reputation: 189

If AttributeSet is an interface, how does it store/retrieve values from xml?

If AttributeSet is an interface, then where does the external (concrete) reading/storing of values from xml lie? i.e. what is the concrete class that has storing/retrieve values delegated to it by AttributeSet? i'm on a goose hunt shmoozing through source code, but i still can't find where the magic is happening. thanks for the help, guys!

Upvotes: 1

Views: 92

Answers (1)

alanv
alanv

Reputation: 24114

Skipping some details in the middle here, but the AttributeSet you're using is typically an XmlResourceParser obtained from AssetManager, which is the class responsible for managing Android application resources including AAPT-compiled XML. The asset manager creates an XmlBlock.Parser for parsing a specific resource block, which represents an XML file, using XmlBlock.newParser().

XmlBlock.Parser implements XmlResourceParser and calls through to native code for parsing AAPT-compiled XML.

XmlResourceParser extends both XmlPullParser and AttributeSet.

Upvotes: 1

Related Questions