我在函数中有一个CountDownTimer。从来没有调用过这个函数。 但onTick回调触发器。为什么会这样?我做错了什么?
public class tasksListActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// code
}
private void find_locations_func(final Context mCon, final String direction) {
Toast.makeText(mCon, "direction = " + direction, Toast.LENGTH_SHORT).show();
new CountDownTimer(300000, 1000) {
public void onTick(long millisUntilFinished) {
// some code
this.onFinish(); // this calls
}
public void onFinish() {
goToLevel(mCon, dataAdapter, syncLayout);
}
}.start();
}
}
所以Toast没有出现,但onFinish被称为