14.06.2011

UI functions

posted by Karsten

/* * UI Functions */ @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, MENU_START, 0, R.string.menu_start); menu.add(0, MENU_STOP, 0, R.string.menu_stop); menu.add(0, MENU_RESUME, 0, R.string.menu_resume); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_START: mGameThread.doStart(); return true; case MENU_STOP: mGameThread.setState(GameThread.STATE_LOSE, getText(R.string.message_stopped)); return true; case MENU_RESUME: mGameThread.unpause(); return true; } return false; } public void onNothingSelected(AdapterView arg0) { // Do nothing if nothing is selected }

Share

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment