등록 페이지와 계정 만들기 페이지가 필요합니다. 계정 생성 페이지에서 귀하의 정보를 입력 한 후 계정 생성 성공 또는 코드 재전송 대화 상자가있는 등록 페이지로 돌아가고 싶습니다.이전 활동에서 수행 한 작업을 기반으로 다른 활동에 대한 대화 상자를 표시하는 방법
현재로서는 웹 서버의 응답을 확인하고 상태에 따라 대화 상자가 표시되고 대화 상자가 튀어 나오면서 백그라운드에서 등록 페이지를 보여주는 계정 만들기 활동을 닫습니다. 귀하의 계정이 생성되거나 코드가 다시 전송됩니다.
그러나 지금까지 대화 상자를 표시하지 않고 내 활동을 마감했습니다. 등록 페이지에서 대화 상자를 열어야한다고 가정하고 있지만 작성된 것인지 묻는 방법을 모르겠습니다. 내가 말한 것을 토대로 적절한 대화를 보여주는 방법에 대한 조언을 해주시면 감사하겠습니다.
, 여기 당신이 당신에 AlertDialog 빌더의 setNeutralButton에서 정보public void btnCreate(View v) throws Exception {
// if we get to here we can send the information to the webserver
String response = makeRequest(email.getText().toString(), fName
.getText().toString(), lName.getText().toString());
if (response != null) {
org.json.JSONObject obj = new org.json.JSONObject(response);
//response is created make created dialog
if ("Created".equals(obj.getString("status"))) {
new AlertDialog.Builder(CreateAccount.this)
.setTitle("Account Creation Successful")
.setMessage(
"An activation code has been sent to you. Please check your SPAM folder if you do not receive your activation code email")
.setNeutralButton("OK", null).show();
// response is resend and sends the resend dialog
} else if ("Resend".equals(obj.getString("status"))) {
new AlertDialog.Builder(CreateAccount.this)
.setTitle("Code Resent")
.setMessage(
"Your activation code has been resent to your email.\n\nIf you are not receiving your activation code, our email is being blocked. Please email us at '[email protected]' and we will manually send you a code.")
.setNeutralButton("OK", null).show();
}
}
//finishes this activity and shows the registration activity (the one before create account)
finish();
}
완벽하게 작동합니다. 일반적으로 한 액티비티에서 다른 액티비티로 데이터를 전송하는 방법이라고 가정합니다. . – Sean