/** {@inheritDoc} */ @Override public final void onClick(final View v) { switch (v.getId()) { case R.id.add: Preferences.setDefaultPlan(this, false); Intent intent = new Intent(this, RuleEdit.class); this.startActivity(intent); break; case R.id.ok: Preferences.setDefaultPlan(this, false); this.finish(); break; case R.id.import_default: intent = new Intent(Intent.ACTION_VIEW, Uri.parse(this.getString(R.string.url_rulesets))); try { this.startActivity(intent); } catch (ActivityNotFoundException e) { Log.e(TAG, "no activity to load url", e); Toast.makeText( this, "no activity to load url: " + intent.getDataString(), Toast.LENGTH_LONG) .show(); } break; default: break; } }