How can I invoke a method every 5 seconds in android?

后端 未结 4 2169
轻奢々
轻奢々 2020-12-11 11:38

I\'m working in an application which must send a GPS location every 5 seconds to the server when I choose (auto send button on). I\'m new with android so I don\'t know how I

4条回答
  •  春和景丽
    2020-12-11 12:01

    Look at the AlarmManager class http://developer.android.com/reference/android/app/AlarmManager.html and particularly the setRepeating function. Its going to be a bit more complicated than you'd like though.

提交回复
热议问题