Get selected item from ListView bound with SimpleCursorAdapter

前端 未结 2 727
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 08:38

I\'m brand new to Android development... coming from iPhone and .Net background. I\'ve seen very similar questions to this one, but none of them dealt with the SimpleCursorA

2条回答
  •  既然无缘
    2020-12-02 09:31

    Another way:

    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterView parent, View arg1, int position, long arg3) {
    
                Cursor cursor = (Cursor) parent.getAdapter().getItem(position);
                //TODO
                }
    });
    

提交回复
热议问题