[Android] Listview出錯

Don't call setOnClickListener for an AdapterView.You probably want setOnItemClickListener instead

http://stackoverflow.com/questions/3402255/setonclicklistener-of-a-listview-not-working

Because the Android API is designed that way if it's assigned to an adapterView, it will throw an exception. Clicking on a listView would mean a click on the entire view, which is usually not very useful anyway, since you mostly want to know in your app which exact child view item (list item) has been clicked, not that the entire listview has been clicked. 

留言

這個網誌中的熱門文章

Grafana K6

[翻譯] 介紹現代網路負載平衡與代理伺服器

Linux 事件驅動筆記