TextInputLayout p = (TextInputLayout)findViewById(R.id.password_txt);

String pass = p.getEditText() . getText() . toString();