From my understanding of application lifecycle (including services) it should go onCreate > onStart > onResume.
Based on this understanding, if you shut down the cycle with a this.stopSelf() in the onCreate it should never fire the onStart.
@Override
public void onCreate()
{
super.onCreate();
Log.i(TAG, "Service starting");
this.stopSelf();
}
@Override
public void onStart(Intent intent, int startId)
{
super.onStart(intent, startId);
Log.i(TAG, "onStart Service");
}
I would expect that the onStart log would not fire. However, LogCat clearly shows that the onStart still runs in spite of the service being terminated in the onCreate.
Is this to be expected? Why is this?