嘿大家为什么我的应用程序会在启动活动中崩溃?我有一个计时器,当计时器用完时,它将切换布局和类......
public void onFinish() {
setContentView(R.layout.high_score);
Intent i = new Intent(start_menu.this, high_score.class);
startActivity(i);
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
TextView scoreTxt = (TextView)findViewById(R.id.score);
int exScore = savedInstanceState.getInt("score");
savedInstanceState.putInt("score", exScore);
super.onSaveInstanceState(savedInstanceState);
scoreTxt.setText("Score: "+exScore);
}
链接中的我的LOGLAT: http://i.stack.imgur.com/XZL7v.png
答案 0 :(得分:0)
你应该发布logcat输出.. 顺便说一句,
Intent intent = new Intent(this, high_score.class);
请参阅:http://developer.android.com/training/basics/firstapp/starting-activity.html