Open pateljigar7210 opened 4 years ago
ArrayList paths = new ArrayList<>();
new ChooserDialog(getActivity()) .withStartFile(Environment.getExternalStorageDirectory().getAbsolutePath().toString()) .enableMultiple(true) .withChosenListener(new ChooserDialog.Result() { @Override public void onChoosePath(String path, File pathFile) { if("/storage/emulated/0".equals(path)){ LogClass.e("FILEs", "list : "+paths); }else { if(paths.contains(path)){ paths.remove(path); }else { paths.add(path); } } } }) // to handle the back key pressed or clicked outside the dialog: .withOnCancelListener(new DialogInterface.OnCancelListener() { public void onCancel(DialogInterface dialog) { LogClass.e("CANCEL", "CANCEL"); dialog.cancel(); // MUST have } }) .withResources(R.string.title_choose_any_file, R.string.title_choose, R.string.dialog_cancel) .withStringResources("Title", "OK", "Cancel") .build() .show();
ArrayList paths = new ArrayList<>();