This service is supposed to handle an intent, so it uses START_REDELIVER_INTENT
to make sure the intent is handled.
}
@Override
- public void onStart(Intent intent, int startId) {
- Message msg = mServiceHandler.obtainMessage();
- msg.arg1 = startId;
- msg.obj = intent.getExtras();
- mServiceHandler.sendMessage(msg);
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ if (intent != null) {
+ Message msg = mServiceHandler.obtainMessage();
+ msg.arg1 = startId;
+ msg.obj = intent.getExtras();
+ mServiceHandler.sendMessage(msg);
+ }
+ return START_REDELIVER_INTENT;
}
@Override