Can I call stopSelf() in Service.onStartCommand?

is it bad form to call stopSelf() while inside a onStartCommand() method?

Off the top of my head, I can’t think of why that would be a problem.

stopSelf(), like a lot of stuff in Android, has no immediate effect. It puts a message on the message queue processed by the main application thread. The actual work of stopping the service will not even begin until sometime after onStartCommand() has returned.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)