CB-5592 Add a comment explaining why we set MIME only for file:

This commit is contained in:
Andrew Grieve 2013-12-20 11:10:33 -05:00
parent 176890f305
commit 6163f17aeb

View File

@ -300,6 +300,8 @@ public class InAppBrowser extends CordovaPlugin {
try {
Intent intent = null;
intent = new Intent(Intent.ACTION_VIEW);
// Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
// Adding the MIME type to http: URLs causes them to not be handled by the downloader.
Uri uri = Uri.parse(url);
if ("file".equals(uri.getScheme())) {
intent.setDataAndType(uri, webView.getResourceApi().getMimeType(uri));