MCPcopy Create free account
hub / github.com/KDE/okular / displayUri

Method displayUri

mobile/android/src/OpenFileActivity.java:40–61  ·  view source on GitHub ↗
(Uri uri)

Source from the content-addressed store, hash-verified

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();

Callers 1

handleViewIntentMethod · 0.95

Calls 3

openUriMethod · 0.95
equalsMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected