3
votes

I want to ask about how to auto refresh the Google Maps?

So i have an activity with radio button inside that user can choose about the interval of the auto refresh. Then I create a class with a map view with class that extends the CountDownTimer. The problem is MyCountDownTimer has a constructor that display it own interface. Here is my CountDownTimer class.

public class MyCountDownTimer extends CountDownTimer{   

    public MyCountDownTimer(long millisInFuture, long countDownInterval) {
        super(millisInFuture, countDownInterval);
        // TODO Auto-generated constructor stub
    }
    @Override
    public void onFinish() {
    //do something when finish
    }
    @Override
    public void onTick(long millisUntilFinished) {
    //do something when the interval is choosen
        LocationManager.requestLocationUpdate(GPS_PROVIDER, userChoosenInterval, 0, LcoationListener)
    }
}

how can i modify this class so my user can choose their own interval of auto refresh, or is there any other way around of how to auto-refresh the goole maps? thanks.

~Regards~

1
Why do you want to refresh the google data? It won't change very often, and you will always see the latest data per default. Do you mean to refresh your data on top of Google? - Niklas Wulff
What is it you want to auto refresh? Is it the users GPS position? or the point on the map that shows the users position or something completely different? - Noloxs

1 Answers

0
votes

I've done something similar, allowing users to set the time interval for a particular action. I used the PreferenceActivity to allow the user to set the time, then read from the preferences within my class to set the user defined time interval.