Hi,

I have defined a BroadcastReceiver*  -- *StartupIntentReceiver, as follows:

*public class StartupIntentReceiver extends BroadcastReceiver {*
* private static final String ACTION =
"android.intent.action.BOOT_COMPLETED";*
*
*
* @Override*
* public void onReceive(Context context, Intent intent) {*
* if (intent.getAction().equals(ACTION)) {*
* Intent service = new Intent(context, MyService.class);*
* context.startService(service);*
* } *
* }*
*}*

I also added the receiver and required permission to AndroidManifest.xml:
*      <receiver android:name="com.test.StartupIntentReceiver">*
*            <intent-filter>*
*                <action
android:name="android.intent.action.BOOT_COMPLETED"></action>*
*            </intent-filter>*
*        </receiver>*
*<uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>*
*
*
But it seems that the defined Service (MyService) does not run when the
system boot up. Any ideas on how to make Service auto-start when system boot
up?

-- 
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