(Uri uri)
| 38 | |
| 39 | |
| 40 | private void displayUri(Uri uri) |
| 41 | { |
| 42 | if (uri == null) |
| 43 | return; |
| 44 | |
| 45 | if (!uri.getScheme().equals("file")) { |
| 46 | try { |
| 47 | ContentResolver resolver = getBaseContext().getContentResolver(); |
| 48 | ParcelFileDescriptor fdObject = resolver.openFileDescriptor(uri, "r"); |
| 49 | uri = Uri.parse("fd:///" + fdObject.detachFd()); |
| 50 | } catch (Exception e) { |
| 51 | e.printStackTrace(); |
| 52 | |
| 53 | //TODO: emit warning that couldn't be opened |
| 54 | Log.e("Okular", "failed to open"); |
| 55 | return; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | Log.e("Okular", "opening url: " + uri.toString()); |
| 60 | FileClass.openUri(uri.toString()); |
| 61 | } |
| 62 | |
| 63 | public void handleViewIntent() { |
| 64 | final Intent bundleIntent = getIntent(); |
no test coverage detected