开发者

my list view is not selectable

开发者 https://www.devze.com 2023-03-13 01:53 出处:网络
hi i make this tutorial http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html but i can\'t select thi item in the listview..

hi i make this tutorial http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html

but i can't select thi item in the listview..

how can i resolve this??

i don'y understand the comments on the blog..

maybe the problem are in here

ListView list = (ListView)findViewById(R.id.ListView_addConta);
    DBAdapter db = new DBAdapter(Contas.this);      
    db.open();    开发者_如何学编程  
    List<Conta> listOfConta = db.getContas();        
    ContaAdapter adapter = new ContaAdapter(this, listOfConta);        
    list.setAdapter(adapter);


Extend ListActivity instead of Activity, and override the onListItemClick method. This way works best for me.

This is a good tutorial: http://www.vogella.de/articles/AndroidListView/article.html

0

精彩评论

暂无评论...
验证码 换一张
取 消