title: Check RTSP URI during onCreate in Android
body: <p>I'm creating a fairly simple Android app for work that will plug a URI into the system video player so that users can easily watch the RTSP stream that we are sending from our Wowza server. </p>
  
  <p>In general, I basically just have a play button that calls:</p>
  
  <pre><code>Uri myURI = Uri.parse("rtsp://ipaddress:1935/path/myStream");    
  Intent intent = new Intent(Intent.ACTION_VIEW, myURI);
  startActivity(intent);
  </code></pre>
  
  <p>but we don't stream from this URI 24/7 and I would like to change the behavior during onCreate so that it will validate the URI before drawing the button, giving me the opportunity to give the user visual feedback that the stream isn't live and save us unneeded support emails. </p>
  
  <p>I've looked at the Uri and URI classes to see if there was a method that I could call to check the URI but nothing seems to really exist. Other URI related questions seem to refer to local files so the dev can just check a file, but I don't think that would work for a live stream. Any advice would be greatly appreciated!</p>