
이와같은 커스텀 뷰에서 지도보기 클릭스 디비에 저장된 위도 경도값을
넘겨주려고 하는데요 어떻게 해야 할지 감이 안잡히네요
버튼 클릭 이벤트를 어떻게 줘야 디비내용을 받아 넘길까요 ?
@Override
public void onItemClick(AdapterView<?> parent, View v, int position,
long id) {
cursor.moveToPosition(position);
String str=cursor.getString(cursor.getColumnIndex("name"));
Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show();
}
});
}
public void mOnClick( View v){
switch (v.getId()) {
case R.id.btn:
Intent i = new Intent(this,test.class);
i.putExtra("message_text", cursor.getString(cursor.getColumnIndex("name")));
startActivity(i);
}
}
}
이렇게해서 디비내용중 name의 값이 넘어가는지 테스트 해보았는데
출력물의 가장 마지막값만 넘어가더군요 클릭된 값이 넘어가게 할 수
없을까요 ?