<?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="@android:id/list" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1" />
<Spinner android:id="@+id/section_spinner"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_margin="5dp" />
</LinearLayout>
what is the difference between @android:id and @id in this case?
You need to use
@+idwhen you are defining your own Id to a view, which in this case is section_spinner. And@android:idis used when you need to set an Id of a view to android’s pre-defined Id in framework. for e.g when using ListActivity, TabWidget/FrameLayout in TabHost and etc.