我有这个代码:
import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.widget.TextView;
public class MActivity extends Activity {
TextView start;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
start = (TextView)findViewById(R.id.start_me);
CountDownTimer aCounter = new CountDownTimer(100000 , 1000) {
public void onTick(long millisUntilFinished) {
start.setText("Remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
start.setText("Finished");
}
};
aCounter.start();
}
}
但是当我运行它时,它会因强制关闭错误而崩溃。你能帮我看看问题出在哪里吗?