title: TextView doesn't setText inside include layout
body: <p>I have a custom dialog in which I include another layout. In this layout there are 3 buttons and a <code>TextView</code> none of these is null. If I click the buttons they work correctly. But the TextView doesn't show any text. The text should appears when I click another button. That's how it should works</p>
  
  <p>Custom dialog layout:</p>
  
  <pre><code>&lt;LinearLayout 
     ............
  
  .....
  &lt;androidx.cardview.widget.CardView
          android:id="@+id/result_card"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          card_view:cardElevation="2dp"
          card_view:cardMaxElevation="2dp"
          android:layout_marginStart="16dp"
          android:layout_marginEnd="16dp"
          android:layout_marginBottom="8dp"
          android:visibility="gone"
          app:cardCornerRadius="8dp"&gt;
  
      &lt;include android:id="@+id/result_layout" layout="@layout/result_block" /&gt;
  
      &lt;/androidx.cardview.widget.CardView&gt;
  
  ....
  ....
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The <code>result_block</code> 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:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:padding="16dp"
      android:background="@color/colorPrimary"
      android:orientation="vertical"&gt;
  
      &lt;TextView
          android:id="@+id/result_txt"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="17dp"
          android:text=""
          android:textColor="@color/colorWhite"
          android:fontFamily="sans-serif-medium"
          android:padding="8dp"/&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="end"
          android:orientation="horizontal"&gt;
          &lt;ImageButton
              android:id="@+id/btn1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/ic_copy_24px_outlined"
              android:layout_marginEnd="16dp"
              android:tint="@color/colorWhite"
              android:background="?attr/selectableItemBackgroundBorderless"
              /&gt;
  
          &lt;ImageButton
              android:id="@+id/btn2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginEnd="16dp"
              android:tint="@color/colorWhite"
              android:src="@drawable/ic_share_24px_outlined"
              android:background="?attr/selectableItemBackgroundBorderless"
              /&gt;
  
          &lt;ImageButton
              android:id="@+id/btn3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:tint="@color/colorWhite"
              android:src="@drawable/ic_volume_up_24px_outlined"
              android:background="?attr/selectableItemBackgroundBorderless"
              /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And now the dialog</p>
  
  <pre><code>private void showDiag() {
          final View dialogView = View.inflate(getActivity(), R.layout.custom_dialog_layout,null);
          final View resultLayout = View.inflate(getActivity(), R.layout.result_block,null);
          final Dialog dialog = new Dialog(getActivity(), R.style.MyAlertDialogStyle);
          dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          dialog.setContentView(dialogView);
  
          final TextView resultTxt = resultLayout.findViewById(R.id.result_txt);
          final ImageButton btn1 = resultLayout.findViewById(R.id.btn1);
          final CardView resultCardView = dialog.findViewById(R.id.result_card_view);
          final TextInputEditText editText = dialog.findViewById(R.id.text_edit);
          final ImageButton clearText = dialog.findViewById(R.id.clear_text);
          MaterialButton resultConfirm = dialog.findViewById(R.id.result_confirm);
          ImageButton btn2 = dialogView.findViewById(R.id.copy_btn);
          ImageButton btn3 = dialogView.findViewById(R.id.share_btn);
  
          resultConfirm.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if(!editText.getText().toString().equals("")) {
                      String theWord = editText.getText().toString();
                      String result = Utils.getSecondWord(theWord);
                      // result it shows me the correct string with no errors or something else
                      resultTxt.setText(result); // doesn't work. Not set the text
                      insertWord(theWord, result);
                      resultCardView.setVisibility(View.VISIBLE);
                      resultCardView.setVisibility(View.VISIBLE);
                  } else {
                      Toast.makeText(getActivity(), "Error", Toast.LENGTH_SHORT).show();
                  }
              }
          });
  
          bt1.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Log.i(TAG, "result: " + resultTxt.getText().toString());
              }
          });
  
          // Share btn
          bt2.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                 Log.i(TAG, "result: " + resultTxt.getText().toString());
              }
          });
  
          btn3.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                 Log.i(TAG, "result: " + resultTxt.getText().toString());
              }
          });
  
          dialog.setOnShowListener(new DialogInterface.OnShowListener() {
              @Override
              public void onShow(DialogInterface dialogInterface) {
                  Utils.revealShow(dialogView, true, null, resultConfirm);
              }
          });
  
          dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
              @Override
              public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                  if (i == KeyEvent.KEYCODE_BACK){
                      Utils.revealShow(dialogView, false, dialog, resultConfirm);
                      return true;
                  }
                  return false;
              }
          });
          dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
          dialog.show();
      }
  </code></pre>
  
  <p>Everything inside the dialog works correctly but the TextView not. Even if I try to write something else like <code>resultTxt.setText("Hello there");</code> the text not appears. Any suggestions?</p>