title: Eclipse Error: Unable to instantiate activity
body: <p>I tried to run my app, but it is crashing before reaching the onCreate() method. I'm new to android and eclipse, so i do not even know where to start searching for the error.</p>
  
  <p>That's the Error Message form LogCat:</p>
  
  <pre><code> 11-22 21:06:59.787: WARN/dalvikvm(433): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433): FATAL EXCEPTION: main
      11-22 21:07:01.468: ERROR/AndroidRuntime(433): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.app/com.example.app.HelloActivity}: java.lang.NullPointerException
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.os.Handler.dispatchMessage(Handler.java:99)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.os.Looper.loop(Looper.java:123)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread.main(ActivityThread.java:4627)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at java.lang.reflect.Method.invokeNative(Native Method)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at java.lang.reflect.Method.invoke(Method.java:521)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at dalvik.system.NativeStart.main(Native Method)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433): Caused by: java.lang.NullPointerException
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at com.example.app.HelloActivity.&lt;init&gt;(HelloActivity.java:51)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at java.lang.Class.newInstanceImpl(Native Method)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at java.lang.Class.newInstance(Class.java:1429)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
      11-22 21:07:01.468: ERROR/AndroidRuntime(433):     ... 11 more
  </code></pre>