if (data.getData() != null) {
Uri uri = data.getData();
Log.d(TAG, "onActivityResult: => checkingIntentCodeAndShowImage => INTETNT_OPEN_FOR_GALLERY_RIGHT_IMAGE is called - getting imageurl from intent data" + uri);
String mimeType = activity.getContentResolver().getType(uri);
if (mimeType == null) {
String path = getPath(activity, uri);
cMethods.cmShowLog(TAG,"checkingIntentCodeAndShowImage => path => " +path);
if (path == null) {
cMethods.cmShowLog(TAG,"checkingIntentCodeAndShowImage => path => " +path);
cMethods.cmShowToast(strings.unexpected_error_occured, getActivityContext);
cMethods.cmShowToast("file path is null ", getActivityContext);
//filename = FilenameUtils.getName(uri.toString());
} else {
picturePath = path;
File file = new File(path);
cMethods.cmShowLog(TAG,"checkingIntentCodeAndShowImage => file => " +picturePath);
//filename = file.getName();
updatingCamerImageList(cMethods, picturePath, activity, openedFor, filesFiledsListValue, productOptionValueIdAndOptionId, pojo);
}
} else {
String[] filePath = {MediaStore.Images.Media.DATA};
Cursor c = activity.getContentResolver().query(uri, filePath, null, null, null);
c.moveToFirst();
int columnIndex = c.getColumnIndex(filePath[0]);
picturePath = c.getString(columnIndex);
c.close();
cMethods.cmShowLog(TAG,"checkingIntentCodeAndShowImage => picturePath => " +picturePath);
if(picturePath!=null) {
updatingCamerImageList(cMethods, picturePath, activity, openedFor, filesFiledsListValue, productOptionValueIdAndOptionId, pojo);
} else {
cMethods.cmShowToast(strings.unexpected_error_occured, getActivityContext);
cMethods.cmShowToast("content provider return value", getActivityContext);
}
}
} else {
Log.d(TAG, "onActivityResult: addPostImagesList code 12 - intent data is null");
cMethods.cmShowToast(strings.unexpected_error_occured, getActivityContext);
cMethods.cmShowToast("uri is null", getActivityContext);
}