title: Determine type of content received via Intent Filter
body: <p>I am working on an app which I want to register in the "Share" list. That part is already taken care of using the following tags in the manifest file:</p>
  
  <pre><code>&lt;intent-filter&gt;
      &lt;action android:name="android.intent.action.SEND"   /&gt;
      &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;data android:mimeType="text/*"/&gt;
      &lt;data android:mimeType="image/*"/&gt;
  &lt;/intent-filter&gt;
  </code></pre>
  
  <p>After looking at a few example on SO and using bits an pieces from each relevant question, I have put together a simple (and yet clumsy) piece of code which, as of now, receives an image shared from the gallery. I have also been able to successfully upload that received image to Facebook.</p>
  
  <p>My question is, I want my App to share a variety of content from various apps. For example, a tweet from Twitter, a URL from the browser, etc. How do I determine the exact nature of the data / content shared from another app to my app? I can process the received data appropriately. But I am stumped as to how I can figure out what content was shared.</p>
  
  <p>The code I have put together for sharing an image is:</p>
  
  <p><em>Note: I am currently running this piece of code in the <code>onCreate()</code> method without any error checking. I will put them in place when I have a clue as to the question in concern.</em></p>
  
  <pre><code>ImageView imgSelectedPhoto = (ImageView)findViewById(R.id.imgDisplaySelectedImage);
  
  Uri imageURI = (Uri) getIntent().getExtras().get(Intent.EXTRA_STREAM);
  Bitmap bitmap = null;
  try {
      bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(imageURI));
          try {
          Utility.scaleImage(getApplicationContext(), imageURI);
          imgSelectedPhoto.setImageBitmap(bitmap);
          } catch (IOException e) {
              e.printStackTrace();
          }
      } catch (FileNotFoundException e) {
          e.printStackTrace();
  }
  </code></pre>
  
  <p>Any help / advice / suggestion is much appreciated.</p>