android - stop START_STICKY service -
i want bulid app run in background when press "start service" , continue in background if app closed or killed. use start_sticky , works, problem when want kill service-the app closed(like want) , error(unfortunately process service has stopped). , service try run again. how stop service? p.s-i searched solution on web without success. my code mainactivty public class mainactivity extends appcompatactivity { private textview textview; private intent i; private static button killserbut; private static final string tag="com.example.elicahi.service"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview=(textview) findviewbyid(r.id.textview1); killserbut=(button)findviewbyid(r.id.kill); killserbut.setonclicklistener(new view.onclicklistener() { @override public void onclick...