我想要OnitemClickListener作为一个listview,但是它不适用于me.it,但给出了Logcat错误。
您的内容必须具有id属性为R.id.list 的listview。
我的应用程序没有启动。我在我的项目中使用sqlite来存储一个数字并在一个listview中显示它。
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:choiceMode="multipleChoice" />此代码用于单击..。
ListView listView1 = (ListView) findViewById(R.id.list);
listView1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "item clicked: ",Toast.LENGTH_SHORT).show();
}
});发布于 2013-02-06 07:22:45
使用@+id/android:list,它可能会起作用
https://stackoverflow.com/questions/14723611
复制相似问题