getPositionForView

public void deleteButtonClick(View v) {
        //TODO Remove favorite - DB + file system
        Toast.makeText(this, "Deleting bookmark", Toast.LENGTH_SHORT).show();
        final int position = getListView().getPositionForView((LinearLayout)v.getParent());
        if (position >= 0) {
            Favorite o = (Favorite) this.getListAdapter().getItem(position);
        }
}

你可能感兴趣的:(position)