title: Custom font for Android listview
body: <p>I have a custom font for my android activity.</p>
  
  <p><strong>MainActivity.class</strong></p>
  
  <pre><code>    private void initControls() {
      // TODO Auto-generated method stub
      header = (TextView) findViewById (R.id.tvAccommodations);
      lv = (ListView) findViewById (R.id.lvAccommodations);
      text = (TextView) findViewById (R.id.textView);
  
      Typeface tf = Typeface.createFromAsset(getAssets(),
              "fonts/heartbre.ttf");
      header.setTypeface(tf);
      text.setTypeface(tf);
  
  
  
      ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
                      R.array.abra_hotel, R.layout.custom_list_text);
              lv.setAdapter(adapter);
              header.setText(value);
  </code></pre>
  
  <p><strong>custom_list_text.xml</strong></p>
  
  <pre><code>&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/list_text"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:textSize="18sp"
  android:textStyle="bold"
  android:text="@string/app_name"
  android:paddingLeft="6dip" /&gt;
  </code></pre>
  
  <p>Android throws NullPointerException. Why is it so? Any help is appreciated. Thanks.</p>
  
  <p><strong>LOGCAT:</strong></p>
  
  <pre><code>    03-08 19:48:03.859: E/AndroidRuntime(413): Caused by: java.lang.NullPointerException
      03-08 19:48:03.859: E/AndroidRuntime(413):  at com.say.philippineexplorer.PlaceAccommodations.initControls(PlaceAccommodations.java:34)
      03-08 19:48:03.859: E/AndroidRuntime(413):  at com.say.philippineexplorer.PlaceAccommodations.onCreate(PlaceAccommodations.java:22)
  </code></pre>