2011-12-06 24 views
0

ExpandableListView中有兩種方法嗎?什麼時候應該在ExpandableListView中使用childs和groups的ID?

getSelectedId() 
    Gets the ID of the currently selected group or child. 
getSelectedPosition() 
    Gets the position of the currently selected group or child (along with its type). 

我們總是使用getSelectedPosition。我很好奇什麼時候應該使用getSeletedId?我們可以使用ID來做什麼?

謝謝!!

+0

我正在做類似的東西這裏http://stackoverflow.com/questions/10611927/simplecursortreeadapter-and-cursorloader – toobsco42

回答

0

當您使用CursorTreeAdapter(基於數據庫的適配器)時,getSelectedId將返回數據庫中記錄的ID。

相關問題