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();

以前にエラー remove Parent View が発生していたため、毎回ユーザー入力ごとに3つのダイアログを作成し、互いに呼び出しています。プロセスを実行する方法は?

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 に答える