コード例 #1
0
  private void initData(String dictPath) {
    dict = DictionaryFactory.fromFileName(dictPath);
    try {
      DictionaryFactory.load(dict);
    } catch (IOException e) {
      e.printStackTrace();
    }

    if (dict != null) {
      loadData();
    }
  }
コード例 #2
0
  @Override
  protected void onDictionaryChanged(String dictPath) {
    try {
      DictionaryFactory.save(dict);
    } catch (IOException e) {
      e.printStackTrace();
    }

    reset();
    initData(dictPath);
  }
コード例 #3
0
  @Override
  public void onClick(DialogInterface dialog, int which) {
    dialog.dismiss();

    if (which == DialogInterface.BUTTON_POSITIVE) {
      if (dFrag instanceof ConfirmDialogFragment) {
        DictionaryFactory.delete(dict);

        fireDictionaryEvent(dict, BaseFragment.EVENT_DELETED);
      }
    }
  }