stopService doesn't stop's my service… why?

前端 未结 11 903
旧巷少年郎
旧巷少年郎 2020-12-03 07:02

i have a background service on my android APP that is getting my GPS position and sending it to a remote db. It work\'s fine.

The problem is when i want to stop the

11条回答
  •  臣服心动
    2020-12-03 07:45

    my problem solved by removing the added views to WindowManager ondestroy

    public void onDestroy() {
        isRunning = false;
        super.onDestroy();
        if (checkBox!=null) {
            windowManager.removeView(getlayoutparm(fabsetting,fabrateus,fabexit,true)); 
            windowManager.removeView(checkBox); 
        }
     }
    

提交回复
热议问题