android - How to stop service itself? -
android - How to stop service itself? -
i have illustration int myint
in service , if myint =
1 i'd stop service itself. service should stop automatically.
@override public void oncreate() { super.oncreate(); if(myint==1){ // need code stopping service here } }
update
apparently cannot stop service due nature of service life cycle. if can check status in onstartcommand, can seek calling stopself() there ?
update 2
for sample code : can seek running stopself()
on seperate thread in post : how can stop receive_boot_completed service
android service int
Comments
Post a Comment