我是新的android.I在我的android应用程序中使用三点菜单,但当我点击三点菜单上的项目..我的应用程序崩溃。有人帮我在这里是我的代码:三点菜单OnClick监听器
enter code [email protected]
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.my_menu,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id=item.getItemId();
switch (id){
case R.id.account:
Intent acc=new Intent(this,Account.class);
startActivity(acc);
break;
case R.id.setting:
Intent seting=new Intent(this,setting.class);
startActivity(seting);
break;
case R.id.feedback:
Intent feedback=new Intent(this,feedback.class);
startActivity(feedback);
break;
case R.id.help:
Intent help=new Intent(this,help.class);
startActivity(help);
break;
case R.id.faq:
Intent FAQ=new Intent(this,FAQ.class);
startActivity(FAQ);
break;
}
return true;
}
份额的崩溃日志与问题 –
'溢出menu' https://stackoverflow.com/questions/39439039/how-to-add-overflow-menu-to-toolbar –