Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why "android:" everywhere?

Why do Android xml layout files need android: before every single view attribute? Doesn't the system know it's Android? If the word is indeed redundant, it would seem that omitting it would save a good fraction of the memory required by these files, not to mention typing by programmers.

like image 650
JohnK Avatar asked Jun 20 '12 01:06

JohnK


1 Answers

It's used to specify that an element or attribute is part of that XML namespace. You can create your own namespaces for your own custom components (and often you will see them with 3rd party libraries). So in that regard, it's not redundant because it prevents name clashes.

like image 94
Tyler Treat Avatar answered Oct 08 '22 06:10

Tyler Treat