getting latitude and longitude using gps every 10 minute in background android

前端 未结 5 1464
猫巷女王i
猫巷女王i 2021-01-01 04:00

I am done getting latitude and longitude using LocationManager and working proper.

Requirement:

get latitude and longitude every

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-01 04:41

    Try By this one :
    
    private void doSomethingRepeatedly() {
          timer.scheduleAtFixedRate( new TimerTask() {
                public void run() {
    
                      try{
    
                //Do your work here
    
                      }
                      catch (Exception e) {
                          // TODO: handle exception
                      }
    
                 }
                }, 0, 10000);
                         }
    

提交回复
热议问题