예제 #1
0
  /** {@inheritDoc} */
  @Override
  public final void onClick(final View v) {
    Intent intent = null;
    switch (v.getId()) {
      case R.id.ok:
        final String n = this.etName.getText().toString();
        final ContentValues cv = new ContentValues();
        cv.put(DataProvider.NumbersGroup.NAME, n);

        Uri uri = this.getIntent().getData();
        if (uri == null) {
          uri = this.getContentResolver().insert(DataProvider.NumbersGroup.CONTENT_URI, cv);
        } else {
          this.getContentResolver().update(uri, cv, null, null);
        }
        intent = new Intent(this, NumberGroupEdit.class);
        intent.setData(uri);
        this.setResult(RESULT_OK, new Intent(intent));
        RuleMatcher.unmatch(this);
        this.finish();
        break;
      case R.id.add:
        this.showNumberDialog(-1);
        break;
      case R.id.name_help:
        this.showHelp(R.string.name_help);
        break;
      case R.id.help:
        this.showHelp(R.string.numbergroup_help);
        break;
      default:
        break;
    }
  }
예제 #2
0
파일: Rules.java 프로젝트: dicer/callmeter
 /** {@inheritDoc} */
 @Override
 protected final void onStop() {
   super.onStop();
   RuleMatcher.unmatch(this);
 }