private void initData(String dictPath) { dict = DictionaryFactory.fromFileName(dictPath); try { DictionaryFactory.load(dict); } catch (IOException e) { e.printStackTrace(); } if (dict != null) { loadData(); } }
@Override protected void onDictionaryChanged(String dictPath) { try { DictionaryFactory.save(dict); } catch (IOException e) { e.printStackTrace(); } reset(); initData(dictPath); }
@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); } } }