<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>
<receiver android:name="com.XXXAdrReceiver1">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</receiver>
public class XXXAdrReceiver1 extends android.content.BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
context.startService(new Intent(context, com.XXMain.class));
}
}
}