How to get gps location once for 5 mins android?

前端 未结 4 1839
独厮守ぢ
独厮守ぢ 2021-02-01 10:55

hi there can anybody give me a sample code for get location for every five minutes please i have tried and i can get location once by cliking on button, but i need it to be disp

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 11:15

    I used runnable for doing this,

        final Runnable r = new Runnable() {
            public void run() {
        //Here add your code location listener call
        handler.postDelayed(this, 300000 );
            }
        };
    
        handler.postDelayed(r, 300000 );
    

提交回复
热议问题