I want to start application when phone starts and want to hide it from
the user so i did in following way. The follinng is broadcast code.


public class yourReceiver extends BroadcastReceiver {
  //  @Override
    public void onReceive(Context context, Intent intent) {
        /*
        Intent i = new Intent(MyService.);
        i.setClass(context, MyService.class);
        context.startService(i);
        */

        Log.e("in broadcast", "in broadcast");
                context.startService(new Intent(context, MyService.class));


    }
}


I also add following to the xml file.

<receiver android:name=".yourReceiver" >
    <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
   </intent-filter>
  </receiver>

    <uses-sdk android:minSdkVersion="3" />
        <uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-
permission>



But when phone starts it seems nothing is happening. It is nto
invoking that broadcast. Can some one tell me that could be wrong in
it ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to