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));
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
;
}
}
protected
void
onActivityResult(
int
requestCode,
int
resultCode, Intent data){
switch
(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
;
}
}
}