showDialog is not working
<p>i am trying to display a dialog which is not working and i am unable to figure out how. Can someone please help me in this matter. Thanks in advance.My code is given below. The edit text's focusable is true. </p>

<pre><code>_loginbtn.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                    System.out.println("username and password in the textboxes is: "+username.toString()+" Password: "+password.toString());

showDialog(PROGRESS_DIALOG_LOADING_ID);                 
getusernamepassword();
                }
            });


        public void getusernamepassword()
        {

            try
            {

        username = "";
        password = "";
        _name = (EditText) findViewById(R.id.username);
        _name.setHint("User Name");
        _password = (EditText) findViewById(R.id.password);
        _password.setHint("Password");

        password = _password.getText().toString();
        username = _name.getText().toString();
        System.out.println("Username from the methode " + username + "password from the methode" + password);
        showDialog(PROGRESS_DIALOG_LOADING_ID);
        InputSource is = new InputSource(new StringReader(login.doLogin(username.toString(), password.toString())));
        PC.CommandParser(is);
        sitesList = MyXMLHandler.sitesList;
        DataBaseName = sitesList.getLoginresult().toString();
        System.out.println("DataBaseName Value in String " + DataBaseName);

        if(DataBaseName==""||DataBaseName.contains("Invalid username and password")||DataBaseName.contains("Server was unable to process request."))
        {
            dismissDialog(PROGRESS_DIALOG_LOADING_ID);
            System.out.println("Invalid user name or password");
            finishdialog.setTitle("Invalid User Name or Password").setMessage("The username or password you enterd is incorrect. Please try again.")
            .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) { 

                }
             }).show(); 
        }
        else
        {
            System.out.println("Valid User name and password");
            dismissDialog(PROGRESS_DIALOG_LOADING_ID);
            Intent i = new Intent(GRIPTechSchedule1Activity.this, ToDoClass.class);
            i.putExtra("dbname", DataBaseName);
            startActivity(i);
            finish();
        }
            }catch(Exception e)
            {
                dismissDialog(PROGRESS_DIALOG_LOADING_ID);
                finishdialog.setTitle("Error").setMessage("Unable to retrieve data. Please check your internet connection")
                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) { 

                    }
                 }).show();
            }

        }

    @Override
        protected Dialog onCreateDialog(int id) {

            if(id==PROGRESS_DIALOG_LOADING_ID){

                ProgressDialog dialog=new ProgressDialog(this);
                dialog.setTitle("Please wait");
                dialog.setIndeterminate(true);
                dialog.setMessage("Verifying Account");

                dialog.show();

                return dialog;

            }

            return null;

        }
</code></pre>
