Is R.layout.listview is same as R.id.listview
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I am new to android programming. I have created a
Will it refer the same ListView? Are there any difference between these two snippets? | ||||
No Both are different. R.id.listView1 :- Represents the id of View which is declared in layout (your XML file) as and R.layout.listView1 :- Represents the layout file (xml file) which into You can do
because ListView is of View family. But you can't do
| |||
Both are representing different means.
represent an widget inside an layout (XML file) that have Attribute as follows :-
where as so both are different. | ||||
this may be id of the listview created by you in the xml file.
and ou are representing the listview in your java file by calling the id.
this is the way of representing a layout in your java file by calling the id of the layout | |||
default
Read more
stackoverflow.comm
No comments:
Post a Comment