在Android開發中,ListView有着很重要的地位,使用的場合也很是的多android
錯誤提示:Your content must have a ListView whose id attribute is 'android.R.id.list'佈局
對於以上錯誤,其實多是由於咱們要實現對ListView中setOnItemClick的事件監聽而去繼承了LiseActivity,可是卻沒有ListView的標籤,網上有說過只要在佈局文件中添加以下代碼便可:spa
<ListView android:id="@android:id/list" 或android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content"> </ListView>
R文件夾不生成list的id.code
setAdapter改用setListAdapter;blog