0
case 2: new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_info)
.setTitle("Socket9 Registeration")
.setMessage("You have been Registered Successfully.Please Login to continue.")
.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override
    public void onClick(DialogInterface dialog, int which) {
     etMobileNo.setText("");
     etPassword.setText("");
    }
    })
    .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int whichButton) {
                       etMobileNo.setText("");
                       etPassword.setText("");
                      }
                    }).show();
break;
case 3: new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Socket9 Registeration")
.setMessage("Your Code doesn't match.Try Again")
.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override
    public void onClick(DialogInterface dialog, int which) {
    dismissDialog(2);
    showDialog(4);

}}).show();
break;
case 4: new AlertDialog.Builder(this)
    .setTitle("Enter Your Registeration Code")
    .setView(input)
    .setMessage("Registeration code has been delivered on your registered number via sms")
    .setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override
        public void onClick(DialogInterface dialog, int which) {
        String value = input.getText().toString().trim();
          String regsCode2=etFake.getText().toString().trim();
          System.out.println("Va "+value+" Reg"+regsCode2);
          if(value.compareToIgnoreCase(regsCode2)==0){
              validCodeMatch=objCommonServices.sendEvalidCode(etMobileNo.getText().toString().trim(), etPassword.getText().toString().trim(),"OK");
                if(validCodeMatch.contains("Code Match")){
                    showDialog(2);
                }
            }
            else{
                dismissDialog(4);
                showDialog(3);  

          }
    }}).show();

我已经创建了 3 个对话框,并且每次在每个用户输入上都互相调用我也尝试关闭Dialog 方法,因为之前我收到错误删除 Parent View 。流程如何进行?

4

1 回答 1

0
 case 3: new AlertDialog.Builder(this)
        .setIcon(android.R.drawable.ic_dialog_alert)
        .setTitle("Arihant Shopee Registeration")
        .setMessage("Your Code doesn't match.Try Again")
        .setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override
            public void onClick(DialogInterface dialog, int which) {
            removeDialog(4);
            showDialog(4);
        }}).show();
        break;
        case 4:AlertDialog.Builder alert = new AlertDialog.Builder(this);
        alert.setTitle("Enter Your Registeration Code");
        alert.setMessage("Registeration code has been delivered on your registered number via sms");
        // Set an EditText view to get user input 
        final EditText input = new EditText(this);
        alert.setView(input);
        alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
                String value = input.getText().toString().trim();
                String regsCode2=etFake.getText().toString().trim();
                System.out.println("Va "+value+" Reg"+regsCode2);
                if(value.compareToIgnoreCase(regsCode2)==0){
                    validCodeMatch=objCommonServices.sendEvalidCode(etMobileNo.getText().toString().trim(), etPassword.getText().toString().trim(),"OK");
                    if(validCodeMatch.contains("Code Match")){
                        showDialog(2);
                    }
                }
                else{
                    removeDialog(3);
                    showDialog(3);              
                }
            }
        });
于 2013-06-17T05:02:54.083 回答