안녕하세요.
텍스트뷰의 값을, 인텐트로 넘기는 과정중에서 어디가 오류여서 넘어가지지 않는지 이유를 잘 모르겠습니다.
넘기는 흐름은 현재의 Seat.java 자바파일 -> Location_and_seat 자바파일 -> Payment 자바파일에 있는
Payment_Total_Money 텍스트뷰로 .setText로 설정이 되어야 합니다..
아래는 처음에 Seat.java에서 Location_and_Seat 자바부분으로 인텐트를 통해 보내는 구조 입니다.
int Total_Amount = 0;
Button Seat_Next_Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_seat);
Seat_Next_Button = (Button) findViewById(R.id.Selection_Success);
Seat_Next_Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),Location_and_Seat.class);
intent.putExtra("Seat_Total_Mount",Total_Amount); // 돈이 payment 부분으로 꼭 가야한다.
startActivity(intent);
}
});
@@
Location_and_Seat 부분에서는 이렇게 받았습니다.
int Receive_Total_Money = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location_and_seat);
Receive_Total_Money = getIntent().getIntExtra("Seat_Total_Mount",0); // 결제금액..
그리고 이걸 다시 Payment로 보냈습니다.
btn3 = (Button) findViewById(R.id.Third_Tab_Button);
btn3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent it = new Intent(getApplicationContext(),Payment.class);
it.putExtra("Receive_Total_Money",0);
startActivity(it);
}
});
그리고 Payment에서는 아래와 같이 받았습니다.
TextView Payment_Total_Money;
int Money;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment);
Money = getIntent().getIntExtra("Seat_Total_Money",0);
Payment_Total_Money = (TextView) findViewById(R.id.Payment_Total_Money);
Payment_Total_Money.setText(Money + "원");
어떻게 된일인지 Payment의 Payment_Total_Money 부분에서는 0원이 뜹니다..
어디가 잘못되었는지 잘 모르겠습니다.