title: How to create an intent that will view a local HTML file on all devices
body: <p>I really don't understand how this can be so difficult but I see it being asked for the last 4 years, and the same problems/errors are always reported by the OP.  I have tried the various solutions given but none work on all devices.  My current code is:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  Uri uri = Uri.fromFile(htmlFile);
  intent.setData(uri);
  intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
  startActivity(intent);
  </code></pre>
  
  <p>This works on my Motorola Photon, my Samsung Galaxy 10.1 Tab and my HTC Droid DNA.  But does not work on a Note 3 or a GS4.  Both of those devices crash, most likely with the ActivityNotFoundException based on what others have reported (I don't have the devices in hand and the users reporting this do not have debuggers).</p>
  
  <p>I also see many apps in the play store that are just for the purpose of reading local HTML files.  So seemingly there is something needed to create the association and allow local HTML files (in the Downloads directory in my particular case) to be viewed by the browser.  Does anybody have a solution that will work on all platforms?</p>