我設置了一個列表視圖上的長單擊監聽器,我想使用單擊項目的索引來檢索相應的對象。根據android docsAndroid AdapterView點擊監聽器參數 - 位置和編號
public abstract boolean onItemLongClick (AdapterView<?> parent, View view, int position, long id)
Parameters
parent The AbsListView where the click happened
view The view within the AbsListView that was clicked
position The position of the view in the list
id The row id of the item that was clicked
我的問題
方法簽名和參數的定義是將「位置」和「ID」始終是相同的?那些定義似乎是可以互換的,所以有什麼區別?