title: Android: How to share image with Share Option menu>
body: <p>I am making a drawing app. Now i want to share my Drawing with share option menu. But drawing canvas image is not attaching while sharing.</p>
  
  <pre><code>         &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item
          android:id="@+id/menu_item_share"
          android:showAsAction="ifRoom"
          android:title="Share"
          android:actionProviderClass=
              "android.widget.ShareActionProvider"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Following is a code of java file</p>
  
  <pre><code>         public boolean onCreateOptionsMenu(Menu menu) {
       /** Inflating the current activity's menu with res/menu/items.xml */
      getMenuInflater().inflate(R.menu.share_menu, menu);
  
      /** Getting the actionprovider associated with the menu item whose id is share */
      mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_item_share).getActionProvider();
  
      /** Setting a share intent */
      mShareActionProvider.setShareIntent(getDefaultShareIntent());
  
      return super.onCreateOptionsMenu(menu);
  }
  
  private Intent getDefaultShareIntent(){
  
  
      Bitmap bitmap = drawView.getDrawingCache();
      String path = Environment.getExternalStorageDirectory().getAbsolutePath() + UUID.randomUUID().toString()+".png";
      File file = new File(path+"/image.png");
      System.out.println("path="+path);
      Intent sharingIntent = new Intent(Intent.ACTION_SEND);
      Uri screenshotUri = Uri.parse(path);
      //Uri screenshotUri = Uri.fromFile(file);
  
      sharingIntent.setType("image/png");
      sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
      startActivity(Intent.createChooser(sharingIntent, "Share image using"));
      return sharingIntent;
  }
  </code></pre>
  
  <p>Please provide me the way to share canvas image with different apps. Thank you</p>