سؤال

I have an Android App In my main activity I have a method, which is started when the user clicks a button.

I want to automate this method to run once a day

The method pulls in information and sends it to an local (phone) database.

I am unsure of the alarm service code.

Do I need to put my method into a service and call that at a specified time?

لا يوجد حل صحيح

نصائح أخرى

It sounds like you want your method to run every single day regardless of whether the application is open or not. In that case you will need to implement a service. See: http://developer.android.com/guide/components/services.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top