1
public int onStartCommand(Intent intent, int flags, int startId) {

}

When a service is started, I pass an intent to startService function. When service is restarted by the OS due to Sticky flag, is that very same intent that I passed to it to start the service be passed to onStartCommand again or will it be null?

  • See https://developer.android.com/reference/android/app/Service.html#START_STICKY and https://developer.android.com/reference/android/app/Service.html#START_REDELIVER_INTENT – CommonsWare Sep 12 '17 at 13:18

1 Answers1

1

Intent is only passed again if you request START_REDELIVER_INTENT

What is START_STICKY,START_NOT_STICKY and START_REDELIVER_INTENT Service

Kuffs
  • 35,581
  • 10
  • 79
  • 92