How can I query GcmNetworkManager to find out if my task is scheduled?

I planned to run the task periodically using GcmNetworkManager , but I do not want it to be saved because I do not want to add android.Manifest.permission.RECEIVE_BOOT_COMPLETED to the list of permissions required by my application. So, I am currently planning a task in onCreate() my main activity. I was wondering if there is a way to ask GcmNetworkManager about my task, and if it is already planned, skip this?

+5
source share
1 answer

Task.Builder has a setUpdateCurrent method ( link ). An optional installer is to determine if this task should override any pre-existing tasks with the same tag. This default value is false, which means that the new task will not override the existing one.

Hope this helps

+2
source

All Articles