![]() |
user click on Options Menu in ActionBarCompat |
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
//return super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case R.id.action_settings:
//match with /res/menu/main.xml
Toast.makeText(this, "Setting", Toast.LENGTH_SHORT).show();
return true;
case R.id.menuid_info:
//match with defined in onCreateOptionsMenu()
Toast.makeText(this, "Info", Toast.LENGTH_SHORT).show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
![download files download files](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8p8OYSJ34x9VZ9cj4IzAOVtRlBOzcLrPRJWQ4iuiJI1eCKjrLYOEL2p2RYTNBidfvJuDOpoiZjXICYCF5ifVUBp09IMGbHsHFSOko1_Xdf4gYrG9MbcBSZDywv5SWAQhCav5OT9OGPE5T/s200/icons_download.gif)
Next:
- ActionBarCompat with Share ShareActionProvider
Visit: ActionBarCompat Step-by-step
No comments:
Post a Comment