From 8a3a578485ff6c12750cdef0083c85ddc2aedd5f Mon Sep 17 00:00:00 2001 From: Mike Cunneen Date: Mon, 14 Jul 2014 13:30:02 +0800 Subject: [PATCH] Use the Chooser Intent instead of directly performing ACTION_VIEW . --- src/android/FileOpener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/FileOpener.java b/src/android/FileOpener.java index 0cfc8bb..a006d8a 100644 --- a/src/android/FileOpener.java +++ b/src/android/FileOpener.java @@ -108,8 +108,8 @@ private void openFile(String url) throws IOException { intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, mimeType); } - - this.cordova.getActivity().startActivity(intent); // TODO handle ActivityNotFoundException + Intent fileChooser = Intent.createChooser(intent, "Open File"); + this.cordova.getActivity().startActivity(fileChooser); // TODO handle ActivityNotFoundException } }