You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/20 17:11:15 UTC
[2/2] git commit: CB-5592 Add a comment explaining why we set MIME
only for file:
CB-5592 Add a comment explaining why we set MIME only for file:
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/6163f17a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/6163f17a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/6163f17a
Branch: refs/heads/dev
Commit: 6163f17aeb901d9ff6b3df68666b2efedcd0162e
Parents: 176890f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Dec 20 11:10:33 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Dec 20 11:10:33 2013 -0500
----------------------------------------------------------------------
src/android/InAppBrowser.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/6163f17a/src/android/InAppBrowser.java
----------------------------------------------------------------------
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));