title: How to get my TextView clickable to display the alert diaglog box?
body: <p>I have the following code but the word &quot;reset password&quot; is not clickable. Even after I add some attributes to my xml, I still can't get it to be clicked. I thought that we should be using a button instead of a textview for clicking on? I have linked the variables to my xml file and set the relevant TextView for it.</p>
  <pre><code> public class LoginActivity extends AppCompatActivity  {
  
      private EditText email;
      private EditText password;
      private TextView reset_password;
      private Button login;
      private Button register;
  
      private FirebaseAuth auth;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_login);
  
          email = findViewById(R.id.email);
          password = findViewById(R.id.password);
          login = findViewById(R.id.login);
          register = findViewById(R.id.register);
          reset_password = findViewById(R.id.reset_password);
  
          auth = FirebaseAuth.getInstance();
  
          login.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String txt_email = email.getText().toString();
                  String txt_password = password.getText().toString();
                  loginUser(txt_email, txt_password);
              }
          });
  
          register.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
  
              }
          });
  
      }
  
      private void loginUser(String email, String password) {
  
          auth.signInWithEmailAndPassword(email, password).addOnSuccessListener(new OnSuccessListener&lt;AuthResult&gt;() {
              @Override
              public void onSuccess(AuthResult authResult) {
                  Toast.makeText(LoginActivity.this, &quot;Login Successful&quot;, Toast.LENGTH_SHORT).show();
                  startActivity(new Intent(LoginActivity.this, MainActivity.class));
                  finish();
              }
          });
  
          reset_password.setOnClickListener(new View.OnClickListener() {
  
  
         public void onClick(View v) {
  
  
                      final EditText resetMail = new EditText(v.getContext());
                      AlertDialog.Builder passwordResetDialog = new AlertDialog.Builder(v.getContext());
                      passwordResetDialog.setTitle(&quot;Reset Password ?&quot;);
                      passwordResetDialog.setMessage(&quot;Enter Your Email To Received Reset Link&quot;);
                      passwordResetDialog.setPositiveButton(&quot;Yes&quot;, new DialogInterface.OnClickListener() {
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              // extract the email and send reset link
                              String mail = resetMail.getText().toString().trim();
                              auth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                                  @Override
                                  public void onSuccess(Void aVoid) {
                                      Toast.makeText(LoginActivity.this, &quot;Reset Link Sent To Your Email&quot;, Toast.LENGTH_SHORT).show();
                                  }
                              }).addOnFailureListener(new OnFailureListener() {
                                  @Override
                                  public void onFailure(@NonNull Exception e) {
                                      Toast.makeText(LoginActivity.this, &quot;Error! Reset Link is Not Sent&quot; + e.getMessage(), Toast.LENGTH_SHORT).show();
                                  }
                              });
                          }
                      });
  
                      passwordResetDialog.setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              // close the dialog
                          }
                      });
  
                      passwordResetDialog.create().show();
                  }
              });
  
          }
      }
  </code></pre>
  <p>This is my xml code:</p>
  <pre><code>&lt;TextView
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;Forgot Password&quot;
          android:layout_below=&quot;@id/password&quot;
          android:id=&quot;@+id/reset_password&quot;/&gt;
  </code></pre>