How to start service at boot on android 4.0.3
<p>I wan't to start service at boot on android 4.0.3 but when i boot my device it not happen in my device and service not start.Help me please thank you</p>

<p>here is my manifest </p>

<pre><code>&lt;application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" &gt;
    &lt;activity
        android:name=".MainActivity"
        android:label="@string/app_name" &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;

    &lt;service android:name="com.android.testsharedpreference.MyService"&gt;&lt;/service&gt;

    &lt;receiver android:name="com.android.testsharedpreference.BootReceiver" &gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.BOOT_COMPLETED" &gt;
            &lt;/action&gt;
        &lt;/intent-filter&gt;
    &lt;/receiver&gt;
&lt;/application&gt;
</code></pre>

<p>my boardcast receiver</p>

<pre><code>    public class BootReceiver extends BroadcastReceiver 
    {
        @Override
        public void onReceive(Context context, Intent intent) 
        {
            if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) 
            {
             context.startService(new Intent(context,MyService.class));
            }
        }
    }
</code></pre>

<p>and my service</p>

<pre><code>     public class MyService extends Service
     {
          @Override
          public IBinder onBind(Intent intent) 
          {
             return null;
          }

          @Override
          public void onCreate() 
          {
               super.onCreate();
              Toast.makeText(MyService.this, "onCreate Service ",                 Toast.LENGTH_LONG).show();
          }

          @Override
          public void onDestroy() 
          {
             super.onDestroy();
             Toast.makeText(MyService.this, "onDestroy Service ",                   Toast.LENGTH_LONG).show();
           }
        }
</code></pre>
