JPuge
JPuge

Reputation: 596

Why is it called android:id, android:textAppearance, etc.?

Why does most of the XML attributes start with android:? It seems like a great waste of typing...

Upvotes: 0

Views: 219

Answers (3)

user658042
user658042

Reputation:

That's just the XML namespace for all android related tags/attributes that you define in the root elements of your XML files. If you don't want to type that much, you can change

 xmlns:android="http://schemas.android.com/apk/res/android"

to

 xmlns:a="http://schemas.android.com/apk/res/android"

This allows you to use elements in a way like

a:id=".."

Instead of a you can use any other name/letter combo too.

Upvotes: 4

Ian
Ian

Reputation: 3520

its about namespace. create your own custom view with custom attributes, and you'll see the difference.

Upvotes: 0

Diego Torres Milano
Diego Torres Milano

Reputation: 69228

This is the namespace defined by xmlns:android="http://schemas.android.com/apk/res/android".

Upvotes: 1

Related Questions