title: Android Dialog InvocationTargetException
body: <p>I want a dialog where the user can enter a Username and a Password to register his application
  the dialog is shown up but if i enter any data and click on my confirm button the exception is coming up =(
  anyone know why i get this exception ?</p>
  
  <pre><code>    Context mContext = getApplicationContext();
      LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
      View layout = inflater.inflate(R.layout.dialog_register_app, (ViewGroup) findViewById(R.id.layout_root));
  
      //Start building dialog
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setTitle(getString(R.string.dialog_register_app_title));
      builder.setView(layout);
      builder.setCancelable(false);
      builder.setPositiveButton(getString(R.string.dialog_register_confirm_button_text), new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int id) {
              //Auslesen der EditText
              EditText oUsername = (EditText) findViewById(R.id.edit_username);
              String strUsername = oUsername.getText().toString(); // This is line where exception is calling
              //Do something with strUsername
          }
     });
     AlertDialog alert = builder.create();
     alert.show();
  ...
  ...
  ...
  </code></pre>