title: Share image on whatsapp in android
body: <p>i want to share image on whats-app and we-chat....and so on.........
  i have image's on gridview....to each image click must will be open shareing option..
  but m tired this make code.....plz help me.....and any idea.....
  and my code below.         </p>
  
  <pre><code>grid_view.setOnItemClickListener(new OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View paramView, int position, long id) {
          String path=String.valueOf(position);
          Intent sharingIntent = new Intent(Intent.ACTION_SEND);
  
          Uri screenshotUri = Uri.parse(path);
          sharingIntent.setType("image/*");
          if (sharingIntent !=null) {
              sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
              sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource:///drawable/" +path + ".jpg"));
              sharingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              startActivity(Intent.createChooser(sharingIntent, "Share image using"));    
          }
          else {
              Toast.makeText(getApplication(), "Plase try agian", 2000).show();
          }
  
      }
  });    
  </code></pre>