Android:自动刷新谷歌地图
我想问一下谷歌地图如何自动刷新?
所以我有一个带有单选按钮的活动,用户可以选择自动刷新的间隔。然后,我创建一个带有地图视图的类,其中的类扩展了 CountDownTimer。问题是 MyCountDownTimer
有一个显示其自己界面的构造函数。这是我的 CountDownTimer 类。
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) } }
我如何修改此类,以便我的用户可以选择自己的自动刷新间隔,或者是否有其他方法可以自动刷新 goole 地图?谢谢。
~问候~
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~
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了类似的事情,允许用户设置特定操作的时间间隔。我使用 PreferenceActivity 允许用户设置时间,然后从类中读取首选项来设置用户定义的时间间隔。
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.