我做了一個自定義listView,它擴展了ListActivity,每行包含2個textview和一個按鈕。android ListView ItemClick獲取子文本
adapter = new SimpleAdapter(this, arraylist, R.layout.simplelistcustom, new String[] { "count","title"},
new int[] {R.id.invisible, R.id.textView11 });
setListAdapter(adapter);
當在列表視圖排一下,我得到的選定行的索引,並通過使用索引 我得到的排子
protected void onListItemClick(ListView listView, View view, int position, long id)
{
super.onListItemClick(listView, view, position, id);
String selection = listView.getItemAtPosition(position).toString();
}
當我顯示在「選擇」輸出logcat的是
{count=6, title=etywewetr}
問題是,我想單獨的內容....這怎麼可能.... plz幫助
thanx提前
哪些內容? – 2011-05-11 05:20:47
{count = 6,title = etywewetr}是兩個單獨的TextView.I想要分別得到標題的值和計數 – 2011-05-11 05:25:27