@Override
        public Dialog onCreateDialog(int id) {
                switch(id) {
                case DIALOG_LOGIN :


            LayoutInflater factoryLogin = LayoutInflater.from(this);
            final View loginView = factoryLogin.inflate
(R.layout.login, null);
            return new AlertDialog.Builder(Main.this)
                .setIcon(android.R.drawable.ic_dialog_alert)
                .setTitle(R.string.login_title)
                .setView(loginView)
                .setPositiveButton(R.string.login_ok, new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {
                        boolean flag = true;

                        EditText idEditText = (EditText)
loginView.findViewById(R.id.login_edit_id);
                        EditText pwEditText = (EditText)
loginView.findViewById(R.id.login_edit_pw);

                        String loginID = idEditText.getText().toString
();
                        String loginPW = pwEditText.getText().toString
();

                        Log.d(Main.DEBUGTAG, "id = " + loginID + " PW = "
+ loginPW);

                                if ( loginID.equals("") ) {
                                         
idEditText.setHint(R.string.login_id_hint);
                                         flag = false;
                                }
                                if ( loginPW.equals("") ) {
                                         
pwEditText.setHint(R.string.login_pw_hint);
                                         flag = false;
                                }

                                if ( flag ) {
                                        flag = checkLogin(loginID, loginPW);
                                        //flag = 
checkLogin("[email protected]", "ttopoo");
                                }

                                // succes "true" , fail "false"
                                if ( !flag ) {
                                        //
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

                                        Toast toast = 
Toast.makeText(getApplicationContext(),
                                                        "Login Failed", 
Toast.LENGTH_SHORT);
                                        toast.show();
                                        // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                } else {
                                        restartApp();
                                }
                    }
                })
                .setNegativeButton(R.string.login_cancle, new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {
                        finishApp();
                    }
                })
                .setNeutralButton(R.string.login_setting, new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {
                        runPreferences();
                    }
                })
                .create();

I have not to close a AlterDialog when flag is "false" and then I
click "PositiveButton"
but, This code is not working.

How can I modify this code?

//  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Toast toast = Toast.makeText(getApplicationContext(),
                  "Login Failed", Toast.LENGTH_SHORT);
toast.show();
// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to