我正在尝试在单击 SherlockActionBar 上的操作项时加载新意图。我的代码如下:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.nav_plan) {
return true;
} else if (item.getItemId() == R.id.nav_my_plans) {
Intent MyPlansIntent = new Intent(this, MyPlans.class);
startActivity(MyPlansIntent);
return true;
} else if (item.getItemId() == R.id.nav_invites) {
Intent InvitesIntent = new Intent(this, Invites.class);
startActivity(InvitesIntent);
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
public boolean onCreateOptionsMenu(Menu paramMenu) {
getSupportMenuInflater().inflate(R.menu.main_nav, paramMenu);
return true;
}
这些是我的进口:
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.app.R;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
但是,点击没有响应。难道我做错了什么?
谢谢