title: Eclipse LogCat error associated with custom font
body: <p>When I launch my app I get the message "Unfortunately [app name] has stopped" on my emulator.</p>
  
  <p>According to my LogCat, the problem is caused by an error on line 19.</p>
  
  <p>Line 19 in MainActivity.java is part of my custom text view code.</p>
  
  <p>If I completely delete my custom text view code in MainActivity.java and the associated TextView in activity_main.xml I do not get the error. Therefore, I have pinpointed that this custom text view seems to be the root of the problem.</p>
  
  <p>I have tried the following troubleshooting:</p>
  
  <ul>
  <li>ensuring the .ttf font file is written in lower case</li>
  <li>ensuring the .ttf font file is actually a .tff file</li>
  <li>storing the .ttf font file under assets</li>
  <li>storing the .ttf font file under fonts subfolder in assets</li>
  </ul>
  
  <p>I have actually been on this simple issue for days. I have read numerous threads that address what seems to be my same problem, but no simple fix seems to work.</p>
  
  <p>Cheers in advance for your help</p>
  
  <p><strong>Font file is located under assets/fonts/quicksandlight.ttf</strong></p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package [package name not displayed];
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.app.Activity;
  import com.jdubbing.scissored.R;
  import android.widget.TextView;
  import android.graphics.Typeface;
  
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splash);
  
      TextView txt = (TextView) findViewById(R.id.customfont);  
      Typeface font = Typeface.createFromAsset(getAssets(), "fonts/quicksandlight.ttf");                                       
      txt.setTypeface(font); 
  
  
       Thread logoTimer = new Thread() {
              public void run(){
                  try{
                      int logoTimer = 0;
                      while(logoTimer &lt; 5000){
                          sleep(100);
                          logoTimer = logoTimer +100;
                      };
                      startActivity(new Intent("com.jdubbing.CLEARSCREEN"));
                  } 
  
                  catch (InterruptedException e) {
                      e.printStackTrace();
                  }
  
                  finally{
                      finish();
                  }
              }
          };
  
          logoTimer.start();
      }
  }
  </code></pre>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:background="@drawable/startbackground" &gt;
  
  &lt;TextView
      android:id="@+id/customfont"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="37dp"
      android:textSize="15sp" 
      android:textColor="#e5e3e3"
      android:text="@string/tell" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>LogCat</strong> Check the last five or six last lines to see the error on line 19 </p>
  
  <pre><code>01-07 03:52:12.442: I/Process(2497): Sending signal. PID: 2497 SIG: 9
  01-07 03:52:19.162: D/dalvikvm(2536): GC_FOR_ALLOC freed 34K, 4% free 2731K/2832K, paused 104ms, total 105ms
  01-07 03:52:19.162: I/dalvikvm-heap(2536): Grow heap (frag case) to 3.312MB for 614416-byte allocation
  01-07 03:52:19.232: D/dalvikvm(2536): GC_FOR_ALLOC freed &lt;1K, 4% free 3331K/3436K, paused 59ms, total 59ms
  01-07 03:52:19.412: D/AndroidRuntime(2536): Shutting down VM
  01-07 03:52:19.412: W/dalvikvm(2536): threadid=1: thread exiting with uncaught exception (group=0xb4ad4b90)
  01-07 03:52:19.422: E/AndroidRuntime(2536): FATAL EXCEPTION: main
  01-07 03:52:19.422: E/AndroidRuntime(2536): Process: [project name not displayed], PID: 2536
  01-07 03:52:19.422: E/AndroidRuntime(2536): java.lang.RuntimeException: Unable to start activity ComponentInfo{[project name not displayed]/[project name not displayed].MainActivity}: java.lang.NullPointerException
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread.access$700(ActivityThread.java:135)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.os.Handler.dispatchMessage(Handler.java:102)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.os.Looper.loop(Looper.java:137)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread.main(ActivityThread.java:4998)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at java.lang.reflect.Method.invoke(Method.java:515)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at dalvik.system.NativeStart.main(Native Method)
  01-07 03:52:19.422: E/AndroidRuntime(2536): Caused by: java.lang.NullPointerException
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at com.jdubbing.scissored.MainActivity.onCreate(MainActivity.java:19)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.Activity.performCreate(Activity.java:5243)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
  01-07 03:52:19.422: E/AndroidRuntime(2536):     ... 11 more
  </code></pre>