Exemple #1
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.menu_sspai:
       openUrl("http://sspai.com/dfg");
       return true;
     case R.id.menu_checkbox_glare:
       updateGlareSetting(!item.isChecked());
       return true;
     case R.id.menu_checkbox_shadow:
       updateShadowSetting(!item.isChecked());
       return true;
     case R.id.menu_about:
       Intent intent = new Intent(getApplicationContext(), AboutActivity.class);
       startActivity(intent);
       return true;
     default:
       return super.onOptionsItemSelected(item);
   }
 }
Exemple #2
0
 void initMenuItem(MenuItem menuItem, BooleanPreference preference) {
   menuItem.setChecked(preference.get());
 }