问题描述
- 安卓acttivity里面添加listview,然后监听里面的view,为什么点击没反应呢
-
部分代码在这里
ListView lv = (ListView) findViewById(R.id.mylv);
lv.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
SimpleAdapter adapter = new SimpleAdapter(this,getData(),R.layout.vlist,
new String[]{"title","info","img"},
new int[]{R.id.title,R.id.info,R.id.img});
lv.setAdapter(adapter);Log.i(ACTIVITY_TAG, "在这里啊============================="); lv.setOnItemClickListener (new AdapterView.OnItemClickListener() { public void onItemClick (AdapterView<?> arg0, View arg1, int arg2, long arg3) { edit.setText("我被点过"); } });
时间: 2025-01-20 14:53:50