title: Set text in TextView in custom dialog
body: <p>I want to set the text in a TextView contained in a custom dialog programmatically, so that I can use <code>Html.fromHtml</code>. In what function should I call <code>setText</code>? I've tried doing it in <code>onCreateDialog</code>, but this does not actually change the text.</p>
  
  <pre><code>public class InfoDialogFragment extends DialogFragment {
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          // Use the Builder class for convenient dialog construction
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  
          LayoutInflater inflater = getActivity().getLayoutInflater();
  
          // Inflate and set the layout for the dialog
          // Pass null as the parent view because its going in the dialog layout
          builder.setView(inflater.inflate(R.layout.infodialog, null));
  
          TextView textView = (TextView) getActivity().findViewById(R.id.info);
          textView.setText(Html.fromHtml("&lt;h1&gt;Text has been correctly set&lt;/h1&gt;"));
          ...
  </code></pre>