I am getting customers documents using FilePicker . After opening FilePicker it shows options to take images from gallery as well as camera .
After taking images , images are visible inside gallery but But i don't want images to be visible inside gallery . and i know there are already questions about hiding images from gallery but not from FilePicker .
What should i do ? I think saving images inside a folder Android/App/data inside internal/external storage will do it . But how to get the folder location and save images there . ? or any other solution that can help?
here is code inside onClick() method .
if (view == pickPhotoBtn) {
FilePickerBuilder.getInstance().setMaxCount(10)
.setActivityTheme(R.style.AppTheme3)
.pickPhoto(getActivity());
}
and this is onActivityResult() method .
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case FilePickerConst.REQUEST_CODE_PHOTO:
if (resultCode == Activity.RESULT_OK && data != null) {
Log.e(TAG, "onActivityResult: ");
for (String path : data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_PHOTOS)) {
String fileName = CommonMethod.getFileNameFromPath(path);
if (!documentNameList.contains(fileName) && !selectPhotosPath.contains(path) && selectPhotosPath.size() < 10) {
selectPhotosPath.add(path);
File file = new File(path);
Log.e(TAG, "Image Name: " + fileName);
documentNameList.add(fileName);
documentIdList.add(0);
selectPhotosBitmap.add(CommonMethod.compressImage(file, getContext()));
}
}
adapter.addItems(selectPhotosBitmap);
adapter.notifyDataSetChanged();
Log.e(TAG, "Number Of Files: " + selectPhotosPath.size());
}
}
}