We can define ids like this:
<TextView android:id="@+id/btn1" />
But there are many activities and many components, the ids may be duplicated with others easily.
Is it able to define nested ides, like:
<TextView android:id="@+id/index/btn1" />
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.
No you cannot. However, you can either 1) create the semblance of a namespace using _ for example:
or 2) you can reuse the same Id but in a different xml file. As long as there aren’t duplicate ids inside of a view, findViewById() will work fine.
See the section on IDs in the docs for more info: http://developer.android.com/reference/android/view/View.html