title: Choose an image from the camera or gallery
body: <p>I have been trying to make the user to choose an image to encrypt from the camera or the gallery. but when i run the code it make me choose from the google drive, then the encrypt code not working. 
  I need help. I tried every solution I could find. </p>
  
  <p>here is the code:
  the button choose: </p>
  
  <pre><code>
     private void ChooseImage() {
          Intent intent = new Intent();
          intent.setType("image/*");
          intent.setAction(Intent.ACTION_GET_CONTENT);
          startActivityForResult(Intent.createChooser(intent,"Select Picture"),PICK_IMAGE_REQUEST);
      }
  </code></pre>
  
  <p>the button encrypt: </p>
  
  <pre><code>btnEncrypt.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  EncryptImage();
                  if(isEncrypted){
                      btnUpload.setEnabled(true);
                      btnEncrypt.setEnabled(false);
                      hintMsg.setText("Image Encrypted Successfully! Upload it to Cloud.");
                      hintMsg.setTextColor(Color.GREEN);
  
                  }
              }
          }); 
  </code></pre>
  
  <p>the encrypt methods:</p>
  
  <pre><code>
      private void EncryptImage() {
          //Convert drawable to Bitmap
  
          Drawable drawable = ContextCompat.getDrawable(EncryptImageActivity.this, R.drawable.ic_lock_outline_black_24dp);
          Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
  
          ByteArrayOutputStream stream = new ByteArrayOutputStream();
          bitmap.compress(Bitmap.CompressFormat.PNG,100,stream);
          InputStream is = new ByteArrayInputStream(stream.toByteArray());
  
          //Create file
          File outputFileEnc = new File(myDir,UUID.randomUUID().toString()+FILE_NAME_ENC);
          try {
              // Encrypt image
              AESEncrypter.encryptToFile(my_key,my_spec_key,is, new FileOutputStream(outputFileEnc));
              //Uri encFile = Uri.parse(myDir.toString());
              //filePath = Uri.parse(outputFileEnc.toString());
              isEncrypted = true;
              imageView.setImageDrawable(drawable);
              Toast.makeText(this, "Image Encrypted!", Toast.LENGTH_SHORT).show();
              //UploadEncrypted(outputFileEnc);
  
          } catch (IOException e) {
              e.printStackTrace();
          } catch (NoSuchAlgorithmException e) {
              e.printStackTrace();
          } catch (InvalidKeyException e) {
              e.printStackTrace();
          } catch (InvalidAlgorithmParameterException e) {
              e.printStackTrace();
          } catch (NoSuchPaddingException e) {
              e.printStackTrace();
          }
  
       }
      private void UploadEncrypted(File outputFileEnc){
         // storageReference = storage.getReferenceFromUrl(filePath).child("");
          StorageReference ref = storageReference.child("images/"+ UUID.randomUUID().toString());
          //Upload input stream to Firebase
          final ProgressDialog progressDialog = new ProgressDialog(this);
          progressDialog.setTitle("Uploading...");
          progressDialog.setMessage("Uploading Encrypted Image ...");
          progressDialog.show();
          InputStream stream = null;
          try {
               stream = new FileInputStream(outputFileEnc);
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
          UploadTask uploadTask = ref.putStream(stream);
          uploadTask.addOnFailureListener(new OnFailureListener() {
              @Override
              public void onFailure(@NonNull Exception exception) {
                  exception.printStackTrace();
                  progressDialog.dismiss();
                  Toast.makeText(EncryptImageActivity.this, "Upload Failed!", Toast.LENGTH_SHORT).show();
              }
          }).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
              @Override
              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                  progressDialog.dismiss();
                  Toast.makeText(EncryptImageActivity.this, "Upload successful!", Toast.LENGTH_SHORT).show();
              }
          });
      }
  </code></pre>