title: Android: Intent createChooser not working properly
body: <p>I am adding share feature in the app. Below is my code:</p>
  
  <pre><code>public static void shareData(String title, String message, Uri imageUri, Activity activity) {
      try {
          Intent sendIntent = new Intent(Intent.ACTION_SEND);
          sendIntent.putExtra(Intent.EXTRA_TITLE, title);
          sendIntent.putExtra(Intent.EXTRA_SUBJECT, message);
          if (imageUri != null) {
              Logger.errorMessage(ShareUtil.class.getSimpleName(), "share if");
              sendIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
              sendIntent.setType("image/*");
          } else {
              Logger.errorMessage(ShareUtil.class.getSimpleName(), "share else");
              sendIntent.setType("text/plain");
          }
          activity.startActivity(Intent.createChooser(sendIntent, "Share using"));
      } catch (Exception e) {
          e.printStackTrace();
          Toast.makeText(activity, "No App found to share", Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p>This is showing the list of apps, but when I select any app, the title and message is not sent. I am not getting what I am doing wrong.</p>