1
나는이 방법으로 어댑터를 통해 몇 가지 목록 항목을 추가했습니다.해당 목록 항목과 관련된 데이터 가져 오기 setOnItemClickListener 통해
classStudentsCollection.add(new mClassStudents(R.drawable.ic_profile, "DataOne", "DataTwo", "DataThree"));
그리고 이러한 목록 항목 중 하나를 클릭 이벤트로 수신하는 수신기가 있습니다.
classStudentsView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(mainAppContext, "position" + position + "id "+id, Toast.LENGTH_SHORT).show();
//get data associated with this particular list object
}
});
지금 나는이 mClassStudents
목록 개체와 관련 된 모든 데이터를 검색 할 수 있습니다. 값 "DataOne", "DataTwo", "DataThree"
을 검색합니다.
어떻게하면됩니까? 도와주세요.