title: Trying to start a service on android and get a null object
body: <p>I am creating an background service for android, so i call:</p>
  
  <pre><code>startService(new Intent(this, RasPiDomBackground.class));
  </code></pre>
  
  <p>Service code:</p>
  
  <pre><code>public class RasPiDomBackground extends Service {
  
  @Override
  public IBinder onBind(Intent intent) {
      return null;
  }
  
  @Override
  public void onCreate() {
      Toast.makeText(this, "Service created!", Toast.LENGTH_LONG).show();
  }
  
  @Override
  public void onDestroy() {
      Toast.makeText(this, "Service stopped", Toast.LENGTH_LONG).show();
  }
  
  @Override
  public void onStart(Intent intent, int startid) {
      Toast.makeText(this, "Service started by user.", Toast.LENGTH_LONG).show();
  }
  }
  </code></pre>
  
  <p>I am getting an error that makes no sense to me.....</p>
  
  <pre><code>1928-1928/nl.digicre8.raspidom W/System.err﹕ java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
  03-23 16:20:22.902    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.content.ContextWrapper.getPackageName(ContextWrapper.java:131)
  03-23 16:20:22.902    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.content.ComponentName.&lt;init&gt;(ComponentName.java:77)
  03-23 16:20:22.902    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.content.Intent.&lt;init&gt;(Intent.java:3996)
  03-23 16:20:22.902    1928-1928/nl.digicre8.raspidom W/System.err﹕ at nl.digicre8.raspidom.RasPiDomAPI.CallAction(RasPiDomAPI.java:149)
  03-23 16:20:22.905    1928-1928/nl.digicre8.raspidom W/System.err﹕ at nl.digicre8.raspidom.MainActivity.LocationService(MainActivity.java:208)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.view.View$1.onClick(View.java:4002)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.view.View.performClick(View.java:4756)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.view.View$PerformClick.run(View.java:19749)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:739)
  03-23 16:20:22.907    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.os.Looper.loop(Looper.java:135)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5221)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
  03-23 16:20:22.909    1928-1928/nl.digicre8.raspidom W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  03-23 16:20:22.969    1928-1977/nl.digicre8.raspidom W/EGL_emulation﹕ eglSurfaceAttrib not implemented
  03-23 16:20:22.969    1928-1977/nl.digicre8.raspidom W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5984f20, error=EGL_SUCCESS
  </code></pre>
  
  <p>Does anybody experienced this issue before? Also the onStart seems to be depricated, is there a alternative for this?</p>