title: Android custom AlertDialog
body: <p>I'm creating a custom <code>AlertDialog</code> and I'm getting one error.</p>
  
  <p>On <code>strings.xml</code> I have defined a string like:</p>
  
  <pre><code>&lt;string name="infoDetail"&gt;Test: &lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;&lt;/string&gt;
  </code></pre>
  
  <p>I've created a custom layout like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;TextView
          android:id="@+id/infoVersionTitle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_centerInParent="true"
          android:gravity="right|center"
          android:text="@string/infoVersion"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView
          android:id="@+id/infoVersionTitleValue"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:layout_toRightOf="@+id/infoVersionTitle"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  
      &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="web"
          android:linksClickable="true"
          android:padding="4dp"
          android:text="@string/infoDetail" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This is the code for creating the <code>AlertDialog</code> with my custom layout:</p>
  
  <pre><code>case R.id.info:
      AlertDialog.Builder about = new AlertDialog.Builder(this);
  
      about.setTitle(getString(R.string.app_name));
      about.setIcon(R.drawable.info);
      about.setView(getLayoutInflater().inflate(R.layout.info, null));
  
  
      TextView infoDetail = (TextView) findViewById(R.id.infoDetailText);
      infoDetail.setMovementMethod(LinkMovementMethod.getInstance());
  
      about.setPositiveButton("OK", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
              dialog.dismiss();                       
          }
      });
      about.show();               
      break;
  </code></pre>
  
  <p>Whit this I'm getting a <code>java.lang.NullPointerException</code> on <code>infoDetail.setMovementMethod(LinkMovementMethod.getInstance());</code>.</p>
  
  <p>If I remove this line my custom layout is shown as expected but the url is not clickable.</p>
  
  <p>What am I doing wrong?</p>