我正在尝试使用 onCreateOptionsMenu 和 onOptionsItemSelected 调用其他活动,但我不知道无法调试并且它不执行操作,我有
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.login_settings, menu);º
//return super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getGroupId();
if(id == R.id.contactMenu) {
Intent intent = new Intent(this, ContactActivity.class);
this.startActivity(intent);
return super.onOptionsItemSelected(item);
}
return true;
}
和菜单项
<group
android:id="@+id/contactMenu"
android:checkableBehavior="single">
<item
android:id="@+id/contactSettings"
android:icon="@drawable/correo"
android:title="@string/ContactUs_settings" />
</group>
太感谢了...