我的情况类似于this
我使用setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS)
和setOnItemClickListener
,但它们不起作用。
这是我的来源:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.database_table_list);
LBD conection = new LBD(this);
conection.open();
setting = conection.tblSettings();
setting.create();
urlLists = setting.selectRssTable();
urlListView = (ListView) findViewById(R.id.listView1);
uAdapter = new UrlArrayAdapter(DatabaseTable.this, urlListView,
urlLists);
urlListView.setAdapter(uAdapter);
urlListView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
urlListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
((BaseAdapter) uAdapter).notifyDataSetChanged();
}
});
}
所有活跃的元素。