diff options
author | Matt Holgate <matt@emobix.co.uk> | 2014-07-02 18:05:43 +0100 |
---|---|---|
committer | Matt Holgate <matt@emobix.co.uk> | 2014-07-02 18:05:43 +0100 |
commit | fe01358a4e3cf8e8c1d625937f89ddb9c1a7d8dc (patch) | |
tree | 03b31b2a834e695b717f70945bae0c8603fa53cd /platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java | |
parent | 8d62114762092e31f3465e17d764d92c94ac4fa5 (diff) | |
download | mupdf-fe01358a4e3cf8e8c1d625937f89ddb9c1a7d8dc.tar.xz |
Pass mimetype when opening a document from a stream.
Fixes opening non-PDF files from email programs that use a ContentProvider
to supply attachments.
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java index bf652d92..062bb03b 100644 --- a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java +++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java @@ -223,12 +223,12 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp return core; } - private MuPDFCore openBuffer(byte buffer[]) + private MuPDFCore openBuffer(byte buffer[], String magic) { System.out.println("Trying to open byte buffer"); try { - core = new MuPDFCore(this, buffer); + core = new MuPDFCore(this, buffer, magic); // New file: drop the old outline data OutlineActivityData.set(null); } @@ -314,7 +314,7 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp } } if (buffer != null) { - core = openBuffer(buffer); + core = openBuffer(buffer, intent.getType()); } else { core = openFile(Uri.decode(uri.getEncodedPath())); } |