title: Sharing current view via ACTION_SEND without storing the image in android
body: <p>I want to share the current view of the app using ACTION_SEND.</p>
  
  <p>The method of converting the current view to bitmap and storing it in external storage for converting the bitmap to a parsable Uri needs permissions.</p>
  
  <p>Snippet:</p>
  
  <pre><code>    public static Bitmap getScreenShot(View view) {
          View screenView = view.getRootView();
          screenView.setDrawingCacheEnabled(true);
          Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
          screenView.setDrawingCacheEnabled(false);
          return bitmap;
      }
  
      // View to BitMap
      Bitmap b  = getScreenShot(getWindow().getDecorView().findViewById(android.R.id.content));
  
      //BitMap to Parsable Uri (needs write permissions)
      String pathofBmp = MediaStore.Images.Media.insertImage(getContentResolver(), b,"title", null);
      Uri bmpUri = Uri.parse(pathofBmp);
  
      //Share the image
      Intent shareIntent = new Intent();
      shareIntent.setAction(Intent.ACTION_SEND);
      shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
      shareIntent.setType("image/jpeg");
      shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
      startActivity(Intent.createChooser(shareIntent, "send"));
  </code></pre>
  
  <p>This needs <strong>WRITE_EXTERNAL_STORAGE</strong> permission, 
  Is there a  way to perform the same without storing it in external storage (without permissions) on Android?</p>