title: Android - Detect URL mime type?
body: <p>In my Android app, I have various URLs that I access from a database and then open a WebView to display that URL. Typically the url looks something like this:</p>
  
  <pre><code>http://www.mysite.com/referral.php?id=12345
  </code></pre>
  
  <p>These referral links always redirect/forward to another url. Sometimes the resulting url is directly to an image. Sometimes it's to a PDF. Sometimes it's to just another HTML page.</p>
  
  <p>Anyways, I need to be able to distinguish between these different types of pages. For example, if the resulting URL links to a PDF file, I want to use the Google Docs Viewer trick to display it. If it's just a plain HTML page I want to simply display it and if it's an image, I am planning on downloading the image and displaying it in my app in a certain way.</p>
  
  <p>I figure the best way to approach this is to determine the mime type of the resulting url.  How do you do this? And is there a better way to accomplish what I want?</p>