Why is this line needed in xml layout file?
xmlns:android="http://schemas.android.com/apk/res/android"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In XML, xmlns declares a Namespace. In fact, when you do:
Instead of calling
android:id, the xml will use http://schemas.android.com/apk/res/android:id to be unique. Generally this page doesn’t exist (it’s a URI, not a URL), but sometimes it is a URL that explains the used namespace.The namespace has pretty much the same uses as the package name in a Java application.
Here is an explanation.
In our examples we will only use URLs.