在我的 android 应用程序中,我想定期调用特定的方法,即。 “每 5 秒后”......我该怎么做......?
您可以使用 Timer用于方法的固定周期执行。
这是一个代码示例:
final long period = 0;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// do your task here
}
}, 0, period);
关于android - 在固定时间间隔后调用特定方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4612579/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |