Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- ...
- ...
- ...
- EditText oUsername = (EditText) layout.findViewById(R.id.edit_username);
- String strUsername = oUsername.getText().toString(); // This is line where exception is calling
- ...
- EditText oUsername = (EditText) layout.findViewById(R.id.edit_username);
- String strUsername = oUsername.getText().toString();
Add Comment
Please, Sign In to add comment