@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.option_menu, menu);
return true;
}
이렇게 해서 옵션메뉴를 생성한뒤
메뉴를 누르면 액티비티를 이동하고 싶은데 선택만 되고 이동이 안되요ㅠㅠ
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case 1:
Intent intent1 = new Intent(HsMonday.this,ListViewHangpActivity.class);
startActivity(intent1);
return true;
case 2:
Intent intent2 = new Intent(HsMonday.this,ListViewHangpActivity.class);
startActivity(intent2);
return true;
}
return false;
}
뭐가 문제일까요...ㅠㅠ
case 1이 문제 인것 같군요
MenuItem의 ID가 1이거나 2일 확률은 거의 없습니다 ㅋㅋ
이런식으로 바꿔보세요