@Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (resultCode == Activity.RESULT_OK) {
     switch (requestCode) {
       case REQUEST_IMAGE_CAPTURE:
         Bundle extras = data.getExtras();
         cryptoCustomerBitmap = (Bitmap) extras.get("data");
         break;
       case REQUEST_LOAD_IMAGE:
         Uri selectedImage = data.getData();
         try {
           if (isAttached) {
             ContentResolver contentResolver = getActivity().getContentResolver();
             cryptoCustomerBitmap =
                 MediaStore.Images.Media.getBitmap(contentResolver, selectedImage);
             cryptoCustomerBitmap =
                 Bitmap.createScaledBitmap(
                     cryptoCustomerBitmap,
                     mCustomerImage.getWidth(),
                     mCustomerImage.getHeight(),
                     true);
             Picasso.with(getActivity())
                 .load(selectedImage)
                 .transform(new CircleTransform())
                 .into(mCustomerImage);
           }
         } catch (Exception e) {
           e.printStackTrace();
           Toast.makeText(
                   getActivity().getApplicationContext(),
                   "Error cargando la imagen",
                   Toast.LENGTH_SHORT)
               .show();
         }
         break;
     }
   }
   getActivity()
       .getWindow()
       .setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
   super.onActivityResult(requestCode, resultCode, data);
 }
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK) {
      Bitmap imageBitmap = null;
      ImageView pictureView = mIdentityImage;

      switch (requestCode) {
        case REQUEST_IMAGE_CAPTURE:
          Bundle extras = data.getExtras();
          imageBitmap = (Bitmap) extras.get("data");
          break;
        case REQUEST_LOAD_IMAGE:
          Uri selectedImage = data.getData();
          try {
            if (isAttached) {
              ContentResolver contentResolver = getActivity().getContentResolver();
              imageBitmap = MediaStore.Images.Media.getBitmap(contentResolver, selectedImage);
              imageBitmap =
                  Bitmap.createScaledBitmap(
                      imageBitmap, pictureView.getWidth(), pictureView.getHeight(), true);
              brokerImageByteArray = toByteArray(imageBitmap);
            }
          } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(
                    getActivity().getApplicationContext(),
                    "Error cargando la imagen",
                    Toast.LENGTH_SHORT)
                .show();
          }
          break;
      }

      if (pictureView != null && imageBitmap != null)
        //                pictureView.setImageDrawable(new BitmapDrawable(getResources(),
        // imageBitmap));
        pictureView.setImageDrawable(ImagesUtils.getRoundedBitmap(getResources(), imageBitmap));
    }
  }