title: Unable to start service [service name] with null
body: <p>i recently coded a Android Widget and tested it on Emulator as well as my Galaxy S , it worked fine on both, after i posted the same to android market now i am getting some error reports.</p>
  
  <p>i am stating a service in the onUpdate of Widget Class like this:</p>
  
  <pre><code>if (appWidgetIds != null) {
      final int N = appWidgetIds.length;
  
      // Perform this loop procedure for each App Widget that belongs to
      // this
      // provider
      for (int i = 0; i &lt; N; i++) {
          // Start Service for each instance
          int appWidgetId = appWidgetIds[i];
          Intent active = new Intent(context, DialerService.class);
          active.setAction("Start");
          active.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
                  appWidgetId);
  
          context.startService(active);
      }
  }
  </code></pre>
  
  <p>the error which some people are getting is:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start service dialer.impact.DialerService@45f926f0 with null: java.lang.NullPointerException
  at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3282)
  at android.app.ActivityThread.access$3600(ActivityThread.java:135)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2211)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:144)
  at android.app.ActivityThread.main(ActivityThread.java:4937)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.NullPointerException
  **at dialer.impact.DialerService.onStart(DialerService.java:18)**
  at android.app.Service.onStartCommand(Service.java:420)
  at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3267)
  ... 10 more
  </code></pre>
  
  <p>error states a <code>NullPointerException</code> on line 18 of the <code>ServiceClass</code> which is this:</p>
  
  <pre><code>@Override
  public void onStart(Intent intent, int startId) {
      //Line 18th 
              String command = intent.getAction();
      int appWidgetId = intent.getExtras().getInt(
              AppWidgetManager.EXTRA_APPWIDGET_ID);
      RemoteViews remoteView = new RemoteViews(getApplicationContext()
              .getPackageName(), R.layout.main);
      AppWidgetManager appWidgetManager = AppWidgetManager
              .getInstance(getApplicationContext());
  }
  </code></pre>
  
  <p>Line 18 is the <code>String command = intent.getAction();</code></p>
  
  <p>what could be the reason for intent being null 
  please help</p>