We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey, I am having Window leaked exception after selecting images. Please help.
My Code is
Intent intent1 = new Intent(getActivity(), ImagePickActivity.class); intent1.putExtra(IS_NEED_CAMERA, true); intent1.putExtra(Constant.MAX_NUMBER, 5); startActivityForResult(intent1, CAMERA_PERMISSION_REQUEST_CODE);``
case CAMERA_PERMISSION_REQUEST_CODE: if (resultCode == RESULT_OK) { if (data != null) { try { ArrayList<ImageFile> list = data.getParcelableArrayListExtra(Constant.RESULT_PICK_IMAGE); /* imagePath.clear(); imagePath = data.getStringArrayListExtra(SelectorSettings.SELECTOR_RESULTS);*/ for (ImageFile files : list) { String extension = ""; String uploadedFileName = files.getPath(); if (null != uploadedFileName) { extension = uploadedFileName.substring(uploadedFileName.lastIndexOf(".")); } File file = new File(uploadedFileName); File attachment = new File(file.getAbsolutePath()); if (attachment.exists()) { FileInputStream fileInputStreamReader = null; try { fileInputStreamReader = new FileInputStream(attachment.getAbsolutePath()); } catch (FileNotFoundException e) { e.printStackTrace(); } byte[] bytes = new byte[(int) attachment.length()]; try { int read = fileInputStreamReader.read(bytes); } catch (IOException e) { e.printStackTrace(); } String attachment_base64 = Base64.encodeToString(bytes, Base64.DEFAULT); attachedPhotosList.add(new AttachedFileModule(attachment_base64, file.getName(), file.getAbsolutePath(), extension)); } } if (attachedPhotosList.size() > 0) { btnUploadPhoto.setVisibility(View.VISIBLE); setImageAdapter(); } } catch (NullPointerException e) { e.printStackTrace(); } } } break;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hey,
I am having Window leaked exception after selecting images.
Please help.
My Code is
The text was updated successfully, but these errors were encountered: