title: Android hyperlinks on TextView in custom AlertDialog not clickable
body: <p>Following my previous question I still have problems managing hyperlinks on my custom <code>AlertDialog</code> but I believe I narrowed down the problem because I think it only not works because it's  a custom dialog.</p>
  
  <p>I have followed all the instructions <a href="https://stackoverflow.com/questions/1997328/android-clickable-hyperlinks-in-alertdialog">here</a> and <a href="https://stackoverflow.com/questions/2795300/how-to-implement-a-custom-alertdialog-view">here</a> but can't seem to bypass this situation</p>
  
  <p>On <code>strings.xml</code> I have a string defined this way:</p>
  
  <pre><code>&lt;string name="link_text_manual"&gt;&lt;b&gt;text2:&lt;/b&gt; This is some other
    text, with a &lt;a href="http://www.google.com"&gt;link&lt;/a&gt; specified
    via an &amp;lt;a&amp;gt; tag.  Use a \"tel:\" URL
    to &lt;a href="tel:4155551212"&gt;dial a phone number&lt;/a&gt;.
  &lt;/string&gt;
  </code></pre>
  
  <p>If I create my dialog this way:</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);
  builder.setTitle("Data")
          .setIcon(R.drawable.info)
         .setMessage(R.string.link_text_manual)
         .setCancelable(true)
         .setNegativeButton("OK", new DialogInterface.OnClickListener() {
             public void onClick(DialogInterface dialog, int id) {
                  dialog.dismiss();
             }
         });
  
  AlertDialog welcomeAlert = builder.create();
  welcomeAlert.show();
  // Make the textview clickable. Must be called after show()
  ((TextView)welcomeAlert.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
  </code></pre>
  
  <p>it shows like this:</p>
  
  <p><img src="https://i.stack.imgur.com/IqvRr.jpg" alt="Image 1"></p>
  
  <p>This works as expected and all clicks are clickable.</p>
  
  <p>Now I want the same thing but on a custom layout.</p>
  
  <p>Created a <code>TextView</code> on my <code>info.xml</code> like this:</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/infoDetailText"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/infoVersionTitle"
      android:autoLink="all"
      android:linksClickable="true"
      android:padding="4dp" /&gt;
  </code></pre>
  
  <p>And this is the code:</p>
  
  <pre><code>    Context ctx = this;
      LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
      View layout = inflater.inflate(R.layout.info, (ViewGroup) findViewById(R.id.infoLayout));
  
      AlertDialog.Builder about = new AlertDialog.Builder(ctx);
      about.setView(layout);
      about.setTitle("Data");
      about.setIcon(R.drawable.info);
  
      AlertDialog displayInfo = about.create();
      displayInfo.show();
      // Make the textview clickable. Must be called after show()
      TextView textView = (TextView) displayInfo.findViewById(R.id.infoDetailText);
      textView.setText(R.string.link_text_manual);
      textView.setMovementMethod(LinkMovementMethod.getInstance());
  </code></pre>
  
  <p>With the above code it shows like this (links not clickable and even not marked as links):</p>
  
  <p><img src="https://i.stack.imgur.com/Ftnbx.jpg" alt="Image 2"></p>
  
  <p>If I remove </p>
  
  <pre><code>    textView.setMovementMethod(LinkMovementMethod.getInstance());
  </code></pre>
  
  <p>it shows like the bellow image (Links marked as links but not clickable):</p>
  
  <p><img src="https://i.stack.imgur.com/ojsMI.jpg" alt="Image 3"></p>
  
  <p>I've also tried to use <code>Linkify</code> and <code>android:autoLink="web"</code> but the result is always the same.</p>
  
  <p><code>setMessage()</code> works but with a custom layout with a <code>TextView</code> can't make it to work.</p>
  
  <p>Probably this is simple but can't seem to make it work. Any suggestions?</p>
  
  <p>Thanks</p>