Last active
December 21, 2015 04:39
-
-
Save YvesBill/6251414 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.main, menu); | |
return true; | |
} | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
switch (item.getItemId()) { | |
case R.id.setting: | |
setting(); | |
return true; | |
case R.id.about: | |
about(); | |
return true; | |
case R.id.credit: | |
credit(); | |
default: | |
return super.onOptionsItemSelected(item); | |
} | |
} | |
private void credit() { | |
Intent credit = new Intent(MainActivity.this, Credit.class); | |
startActivity(credit); | |
} | |
private void about() { | |
Intent about = new Intent(MainActivity.this, About.class); | |
startActivity(about); | |
} | |
private void setting() { | |
Intent setting = new Intent(MainActivity.this, Setting.class); | |
startActivity(setting); | |
}} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment