title: How to show user entered EditText value in a android dialogue box
body: <p>my modified sample of my work basically below  i have 2 editboxes i want the values of the both to be shown in an alertbox, rest of the code works fine, the alertbox does show up but without the entered values.</p>
  
  <pre><code>public class Main extends Activity {
  
      EditText username = null;
      EditText password = null;
      Button login;
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          EditText usern = (EditText) findViewById(R.id.username);
          EditText pass = (EditText) findViewById(R.id.password);
          Button login = (Button) findViewById(R.id.login);
          String usernm = usern.getText().toString();
          String passnm = pass.getText().toString();
          final Builder alert = new AlertDialog.Builder(this)
              .setTitle("SHOW FIELDS")
              .setMessage("USERNAME:" + usernm + "  PASSWORD:" + passnm)
              .setNegativeButton("CLOSE", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) { 
                      // do nothing
                      closeContextMenu();
                  }
               });
           login.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {
                   alert.show();
               }
           });
  </code></pre>