title: Safeguard against "a matching Activity may not exist" in android settings
body: <p>The majority of the Activity Actions (used to launch various Settings activities) in the <a href="http://developer.android.com/reference/android/provider/Settings.html" rel="nofollow noreferrer">Settings</a> class come with a warning :</p>
  
  <blockquote>
    <p>In some cases, a matching Activity may not exist, so ensure you safeguard against this.</p>
  </blockquote>
  
  <p>So how do I safeguard against this ?</p>
  
  <pre><code>try {
      final Intent i = new Intent(Settings. ACTION_WIRELESS_SETTINGS); // say
      i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // not sure if needed
      startActivity(i);
  } catch (Exception e) { // what should I catch here 
      // I would hate to catch Throwable, but should I ?
  }
  </code></pre>
  
  <p>If I read <a href="https://stackoverflow.com/questions/12474777/android-settings-action-device-info-settings-crashes-on-android-4-1-1">this</a> correctly for instance a runtime exception (NPE) is thrown. I would love to use something more specific though like <a href="http://developer.android.com/reference/android/content/ActivityNotFoundException.html" rel="nofollow noreferrer"><code>ActivityNotFoundException</code></a> - but is it enough ?</p>