在我的方法中,我想调用另一个将在1秒后运行的方法.这就是我所拥有的.
final Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
MyMethod();
Log.w("General", "This has been called one second later");
timer.cancel();
}
}, 1000);
Run Code Online (Sandbox Code Playgroud)
这是应该怎么做的?自从我使用Android以来,还有其他方法吗?可以重复没有任何问题吗?