Difference between "@+id/android:list" & "

Put your problem here if it does not fit any of the other categories.

Difference between "@+id/android:list" & "

Postby Anil » Mon Jan 21, 2008 9:23 pm

I have a basic question:
What's the difference between

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ListView id="@+id/android:list"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


(in Notepadv2 tutorial)

and

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ListView id="@android:id/list"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


(in ApiDemos/View/List7)

or are they identical?
and when should we use each...
Anil
Developer
Developer
 
Posts: 44
Joined: Fri Jan 04, 2008 9:15 pm

Top

Postby plusminus » Mon Jan 21, 2008 9:51 pm

Hello Anil,

I'd prefer the second one ( id="@android:id/list" ) because it shows clearer that you are referring to an Android-built-in ID and not creating on at that point. (Remember "@" means 'relative' and "+" means 'add ID')

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests