안드로이드 개발 질문/답변
(글 수 45,052)
private static final int MENU_START = 1;
private static final int MENU_STOP = 2;
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
menu.add(0, MENU_START, 0, "Start Animation");
menu.add(0, MENU_STOP, 1, "Stop Animation");
((TextView)findViewById(R.id.TextView01)).setText("I am here");
return true;
}
public boolean onOptionsItemSelect(MenuItem item){
//((TextView)findViewById(R.id.TextView01)).setText("I am here!!!!!");
switch (item.getItemId()){
// do something with the clicks
case MENU_START:
((TextView)findViewById(R.id.TextView01)).setText("START!!!!!");
return true;
// TODO: Define what to do on click
case MENU_STOP:
((TextView)findViewById(R.id.TextView01)).setText("STOP!!!!!");
return true;
}
return false;
}오늘 안드로이드 프로그래밍을 시작했는데요.
이상하게 메뉴에서 버튼을 눌러도
텍스트 뷰에서 반응이 없네요.
왜그럴까요
다른거 또 추가해야하는게 있나요?
그래서 무조건 아무거나 눌러도 나오게도 해봤는데,
그래도 안나오네요.



