Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onActivityResult(int requestCode, final int resultCode, Intent data) {
- Log.d(getClass().getName(), "onActivityResult");
- if (resultCode == Activity.RESULT_OK) {
- Image image = ImagePicker.getFirstImageOrNull(data);
- if (image != null) {
- String path = image.getPath();
- Log.d(getClass().getName(), "ImagePath: " + path);
- Bitmap bitmap = BitmapFactory.decodeFile(path);
- Bitmap scaled = scaleDown(path, bitmap, 800, false);
- if (requestCode == 1) {
- mPhotoPath = path;
- photoImageView.setImageBitmap(scaled);
- photoImageView.setVisibility(View.VISIBLE);
- takePhotoButton.setVisibility(View.GONE);
- removePhotoButton.setVisibility(View.VISIBLE);
- }
- } else {
- Log.d(getClass().getName(), "Image null");
- }
- }
- super.onActivityResult(requestCode, resultCode, data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement