title: How to get View set on the alert in it's OnClickListener
body: <p>My aim is to change the text of a <code>TextView</code> when user clicks on it and replace it with player name whic user enters. So I added a <code>OnClickListener</code> to it. So on click I prompt a <code>Dialog</code> for user input.</p>
  
  <pre><code>private void setPlayerName(TextView textView) {
      AlertDialog.Builder alert = new AlertDialog.Builder(this);
  
      alert.setTitle("Title");
      alert.setMessage("Enter Player1 Name");
  
      // Set an EditText view to get user input 
      final EditText inputText = new EditText(this);
      alert.setView(inputText);
  
      alert.setPositiveButton("Ok", new inputclickListener(textView));
  
      alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int whichButton) {
              dialog.cancel();
          }
      });
  
      alert.show();
  }
  </code></pre>
  
  <p>Now code for inputclickListener class is as follows</p>
  
  <pre><code>class inputclickListener implements android.content.DialogInterface.OnClickListener {
  
      TextView textView;
  
      public inputclickListener(TextView textView){
          this.textView = textView;
      }
  
  
      @Override
      public void onClick(DialogInterface dialog, int which) {
          //String value = inputText.getText().toString();    //Here I need reference to inputtext
          if(value != null &amp;&amp; value.length()&gt;0) {
              textView.setText(value);
          }
  
      }
  
  }
  </code></pre>
  
  <p>As mentioned in the comment of the code in <code>inputclickListener</code> class I need the reference to inputText which is an <code>EditText</code> view. My question is how can I get that reference given that we have the reference to it's <code>Dialog</code>(I think this should be the Views/EditText parent.. correct me if i am wrong)?</p>