Reputation: 341
Android maintains all the resource ids in R.java. What if we creates views at runtime without id ? Will they be included into R.java and those view's state will be maintained by android system like the view which was created with id?
Please let me know what are issues we would face at run time if we haven't set id for the views.
Upvotes: 0
Views: 60
Reputation: 2211
From android developer official site-
Views may have an integer id associated with them. These ids are typically assigned in the layout XML files, and are used to find specific views within the view tree.
So, I can say, id is what you need to work with that view. If you don't set id for a view you won't be able to use that view.
And according from this, if you don't set id then it won't be added in R.java
You can get more from here
Upvotes: 2