0

I have two services in my Android app. In that I am running my services every single minute. but some mobile devices services are stopping, but it's not executing the onDestroy() method.

My question is how to run a service in every one minute without stopping. Because my app is completely depends on background service only.

I am using Timer Task. Please give me proper solution with TimerTask.

TimerTask timerTask = new TimerTask() {
    @Override
    public void run() {
        process();
    }
};
Timer mTimer = new Timer();
mTimer.schedule(timerTask, 0,60*1000);

process() Method is doing all the task. Its producing the notifications in app.

0 Answers0