开发者

How to close main class for stopService

I want to close my clas开发者_StackOverflow中文版s for stopService(); , and i am using this method but i know that it's false , please help me:

if (Main_Page.this.finish() == true){
stopService(svc);
}

Thank you ...


use this

public void onDestroy(){
 super.onDestroy();
 stopService(new Intent(this,yourservice.class));
}


if you want to stop your service .. then do that in onDestroy() call back of your activity

public void onDestroy(){
 super.onDestroy();
 stopService(svc);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜