From 6163f17aeb901d9ff6b3df68666b2efedcd0162e Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Fri, 20 Dec 2013 11:10:33 -0500 Subject: [PATCH] CB-5592 Add a comment explaining why we set MIME only for file: --- src/android/InAppBrowser.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index aa89446..34e96d9 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -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));