What is difference between @+id/android:list and @+id/list

Resource IDs in Android are specific to a package (which is good, or else you’d have lots of conflicts if your app is dealing with several packages at the same time).

@+id/list will create a resource ID in your app (=your package) with the name “list” and give it a unique ID. In code, that would be R.id.list.

@android:id/list will use the ID “list” from the package android (which, in code, would be android.R.id.list.

EDIT: Need to add the corrections David Hedlund pointed out: The proper reference would be @android:id/list. Also, + indicates you’re defining a new ID – you obviously don’t need that when you’re referencing something that was defined in the Android API.

Leave a Comment