title: Calling background service from BroadcastReceiver
body: <p>I am trying to call a push notification background service from BroadcastReceiver class, but my application crashes.  The code is given below:</p>
  
  <pre><code>public class AlarmReceiver extends BroadcastReceiver {
  
      static int count=1;
  
      @Override
      public void onReceive(Context context, Intent intent) {
  
          Intent myIntent=new Intent(context,NotifyService.class);
          myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  
          context.startActivity(myIntent);  
      }
  } 
  </code></pre>
  
  <p>The manifest entry: </p>
  
  <pre><code>&lt;receiver android:name=".AlarmReceiver"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.BOOT_COMPLETED"/&gt;
      &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  &lt;service android:name=".NotifyService"&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>05-24 15:17:00.042: ERROR/AndroidRuntime(424): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.alarm/com.android.alarm.NotifyService}; have you declared this activity in your AndroidManifest.xml?
  </code></pre>
  
  <p>When I call this service through an Activity it's working, but my goal is to call this service from a BroadcastReceiver.</p>