I am wondering what's the difference between @+id/android:list
and @+id/list
. I know the last one which is a regular id assignment but the first looks different. What makes it special?
Where I saw it: I was studying on ListView, ListAdapter and things like that and the author define the ListView in layout xml file as below :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<TextView
android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/main_no_items"/>
</LinearLayout>
and also let me mention @+id/android:empty
id as well.
And he also extends ListActivity
class.
Here is the source of the article.
And also what's in my mind as questions are :
- Should we extend
ListActivity
? Maybe I want an Activity which also contains other Views. - We use
@+id/android:list
just because we extendListActivity
or we can use the same convention if we extendActivity
?
Thanks.