setOnItemClickListener不起作用

时间:2012-08-13 14:57:38

标签: android onitemclicklistener

我的情况类似于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();
        }
    });
}

enter image description here

所有活跃的元素。

Helped me to this link

0 个答案:

没有答案