title: How to add same onClickListener in every textView in android dialog?
body: <p>I have a custom android dialog which has several textViews. each textview is showing a different text. The intention is when user clicks on a textview, the dialog should be closed and the textColor of that textview should be returned to the parent.</p>
  
  <p>This is my dialog layout.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#ff000000"&gt;
  
  &lt;TextView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="White"
      android:id="@+id/textView_white"
      android:layout_gravity="center_horizontal"
      android:textSize="30dp"
      android:textIsSelectable="true"
      android:clickable="true"
      android:gravity="center"
      android:paddingTop="5dp"
      android:paddingBottom="5dp"
      android:textColor="#fffffbfd" /&gt;
  
  &lt;TextView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Black"
      android:id="@+id/textView_black"
      android:layout_gravity="center_horizontal"
      android:textSize="30dp"
      android:textIsSelectable="true"
      android:clickable="true"
      android:gravity="center"
      android:paddingTop="5dp"
      android:paddingBottom="5dp"
      android:textColor="#ffffffff"
      android:password="false"
      android:background="#ff000000" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I am launching the dialog this way from the parent activity:</p>
  
  <pre><code>        final Context context = MyWidgetConfigureActivity.this;
          final Dialog dialog = new Dialog(context);
  
          dialog.setContentView(R.layout.color_chooser);
          dialog.setTitle("Choose Text Color");
  
          dialog.show();
  </code></pre>
  
  <p>I want to add same onClickListener to every textView inside the dialog. How to acheive this? There are 20+ textViews in the dialog, I dont want to add onClickListener to each textViews manually? is there any better way to do the same?</p>