0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/darker_gray"> <TextView android:text="VIP List" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Kunal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Kagure" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> <TextView android:text="Lyla" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#4CAF50" android:textSize="24sp" /> </LinearLayout> 

This is how a typical layout looks like in Android, so I see all the android: are redundant, I understand that the purpose of the namespace is disambiguate the elements, so is there a way if I just write text = "Name", it will be interpreted as android:text = "Name" by setting some global default perhaps?

1 Answer 1

0

android xml need this element (android:...) Because some libraries need to use (app:...), or even you create custom view and personal custom attribute for view.

you can see custom view by Defining custom attrs this link.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.