title: service not started on BOOT COMPLETE
body: <p>I have a service that I would like to start on BOOT COMPLETE</p>
  
  <p>when it is started , I have a toast message displayed. </p>
  
  <p>my problem is that when the device boots up , the toast is displayed and is stuck on screen, and the service is not starting correctly.</p>
  
  <p>however if I am trying to start my service through an activity , the service is starting well and the toast disappears after a few seconds correctly.</p>
  
  <p>my manifest:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.tfl.extprotocolservice"
      android:versionCode="7"
      android:versionName="1.6" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="21" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_SETTINGS"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;receiver android:name="com.tfl.extprotocolservice.ExtProtocolBroadcastReceiver"
              android:enabled="true" &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=".ExtProtocolService" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.tfl.extprotocolservice.ISetIpPort" /&gt;
              &lt;/intent-filter&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.tfl.extprotocolservice.IExtMessage" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
   &lt;!-- 
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name"
              android:screenOrientation="landscape" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
   --&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>my broadcast receiver:</p>
  
  <pre><code>public class ExtProtocolBroadcastReceiver extends BroadcastReceiver {
  
  
      /* broadcast receiver to start on BOOT COMPLETE*/
      @Override
      public void onReceive(Context context, Intent intent) {
          Intent StartServiceIntent=new Intent(context,ExtProtocolService.class);
          context.startService(StartServiceIntent);
  
      }
  
  }
  </code></pre>
  
  <p>btw, the activity in the manifest is commented because I don't really need it , it was just to test starting the service from an activity.</p>