-2

我的应用程序有操作溢出,我放置了设置按钮,我替换了设置按钮。当我点击设置按钮时,应用程序崩溃

 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);
   }
4

1 回答 1

1

Whitout 知道你的 logcat 的输出,我想到的第一件事。您是否已将 Setting.java 添加到您的 AndroidManifest.xml 文件中?

<activity
        android:name=".Setting">
</activity>
于 2013-09-12T07:32:16.323 回答