Answer the question
In order to leave comments, you need to log in
How to change or update the service?
I need to change the interval when my service is already running. I thought the startService(intent) method would help change the service time interval, but doesn't work. Saw a similar implementation with Thread when the service is running in 2 threads, but don't know how it works, I can't figure out how to do it, for 3 days I can't find anything.
Here is my main service class that works and the second one where you will need to do the service update time.
I mean that the service is started, that is, the time at which the service is performed and the RepeatingAlarmService class wakes up. I can say simply, this interval is now written in the interval variable in this code below:
alarmManager.setRepeating(
AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime() + FIRST_RUN,
interval,
pendingIntent);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question