我的应用程序有操作溢出,我放置了设置按钮,我替换了设置按钮。当我点击设置按钮时,应用程序崩溃
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
// Something else
case R.id.action_settings:
Intent intent = new Intent(this, Setting.class);
startActivity(intent);
default:
break;
}
return super.onOptionsItemSelected(item);
}