public void about() { GWT.log("about()"); if (aboutDialog == null) { aboutDialog = new AboutDialog(); } aboutDialog.show(); }
/* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.MenuItemShowHelp: String targetURL = getString(R.string.AboutZipSignerDocUrl); Intent wsi = new Intent(Intent.ACTION_VIEW, Uri.parse(targetURL)); startActivity(wsi); return true; case R.id.MenuItemDonate: String donateURL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=24Y8S9UH5ETRU"; Intent di = new Intent(Intent.ACTION_VIEW, Uri.parse(donateURL)); startActivity(di); return true; case R.id.MenuItemManageKeys: // Launch the ZipSignerActivity to perform the signature operation. Intent mki = new Intent("kellinwood.zipsigner.action.MANAGE_KEYS"); // Activity is started and the result is returned via a call to onActivityResult(), below. startActivityForResult(mki, REQUEST_CODE_MANAGE_KEYS); return true; case R.id.MenuItemAbout: AboutDialog.show(this); return true; } return false; }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.about) { AboutDialog.show(this); return true; } return super.onOptionsItemSelected(item); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.mainmenu_about: AboutDialog aboutDialog = new AboutDialog(this); aboutDialog.show(); break; } return super.onOptionsItemSelected(item); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_about: AboutDialog dialog = new AboutDialog(this); dialog.show(); return true; case R.id.menu_app_settings: AppSettingsActivity.Launch(this); return true; } return super.onOptionsItemSelected(item); }
// code which handles the action for each menu item public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: { Intent preferences_intent = new Intent(); preferences_intent.setComponent( new ComponentName(download_photos.this, preferences.class)); preferences_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(preferences_intent); return true; } case R.id.logout: { try { download_photos.this.facebook.logout(getApplicationContext()); } catch (IOException e) { e.printStackTrace(); } mPrefs = getSharedPreferences("COMMON", MODE_PRIVATE); SharedPreferences.Editor editor = mPrefs.edit(); editor.putString("access_token", null); editor.putLong("access_expires", 0); editor.putBoolean("logout", true); editor.commit(); finish(); return true; } case R.id.about: { // shows our customized about dialog AboutDialog about = new AboutDialog(this); about.show(); return true; } // lets deal with default case default: return super.onOptionsItemSelected(item); } }