@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case R.id.action_settings:
(我必须在这里写一下应用程序会打开另一项活动吗?)
答案 0 :(得分:0)
switch (item.getItemId()){
case R.id.action_settings:
Intent i = new Intent(this, AnotherActivity.class);
startActivity(i);
break;
}
答案 1 :(得分:0)
写下此内容以打开新活动 -
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
// Handle presses on the action bar items
switch (item.getItemId())
{
case R.id.action_settings:
Intent intent = new Intent(YourCurrentActivity.this, NextActivity.class);
startActivity(intent);