How to solve foreclose problem in start up my application?
<p>I am developing an android application,I want to my application automatically invoked,when I switch on my device.so i used  this permission <code>&lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;</code> in my application's manifest.xml file and i used service , activity and register Broadcast receiver in manifest.xml file.but I got foreclose error appear in when will i start up my device.How solve this proplem.
My Receiver code given bellow
 context.startActivity(new Intent(context,ServicesDemo.class));<br>
//In my mainfest.xml for myReceiver</p>

<pre><code>&lt;receiver android:name=".MyReceiver"&gt;
 &lt;intent-filter&gt;
  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
  &lt;category android:name="android.intent.category.HOME" /&gt;  
 &lt;/intent-filter&gt; &lt;/receiver&gt;
</code></pre>

<p>I got this exception <code>java.lang.RuntimeException: Unable to start receiver com.servicedemo.MyReceiver: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</code></p>
