onClickListener가 view에 포함되어있는걸 보고
textview를 누르면 해당 textview에서 사용하는 데이터를 가지고 액티비티간 통신이 되게 하려고 했거든요 ㅠ
그런데 다 됐다고 생각하고 디버깅해보니 마치 listener가 없는것처럼 아무 반응이 없네요..
어디가 잘못된건지.. 아예 제가 접근을 잘못한건지..(이렇게 못하는건지..?) 알려주셨으면 좋겠습니다 ㅠㅠ
+ dateOnClick의 경우는 xml파일쪽에서 해당 textView에 android:onClick="dateOnClick"으로 작성해둔 상태입니다
* 일단 text_applyDate쪽(id로는 applyDate)쪽이 리스너 받게 했다고 생각하고 구동한 상태였습니다.. chargeDate쪽은 아직 손 안댔구요 ㅠ
TextView text_applyDate= (TextView)findViewById(R.id.applyDate);
text_applyDate.setText(String.format("지난달 %d일 ~ 이번달%d일",tempt_applyStartDate, tempt_applyEndDate));
TextView text_chargeDate= (TextView)findViewById(R.id.chargeDate);
text_chargeDate.setText(String.format("이번달%d일",tempt_chargeDate));
//date값 intent로 보내기
public void dateOnClick(View v) {
switch(v.getId()) {
case R.id.applyDate:
Intent intentApplyDate= new Intent(this, MenuApplyDateActivity.class);
intentApplyDate.putExtra("DateIn", tempt_applyEndDate);
startActivityForResult(intentApplyDate, ACT_EDIT_SUPPLY);
break;
case R.id.chargeDate:
Intent intentChargeDate= new Intent(this, MenuApplyDateActivity.class);
intentChargeDate.putExtra("DateIn", tempt_applyEndDate);
startActivityForResult(intentChargeDate, ACT_EDIT_CHARGE);
break;
}
}
//date값 intent로 받기
protected void onActivityResult(int requestCode, int resultCode, Intent data){
switch(requestCode) {//requestcode 조사
case ACT_EDIT_SUPPLY:
if(resultCode== RESULT_OK){
tempt_applyEndDate= data.getIntExtra("DateOut", tempt_applyEndDate);
}
break;
case ACT_EDIT_CHARGE:
if(resultCode== RESULT_OK){
tempt_chargeDate= data.getIntExtra("DateOut", tempt_chargeDate);
}
break;
}
}
}