private MuPDFCore openFile(String path) { int lastSlashPos = path.lastIndexOf('/'); mFileName = new String(lastSlashPos == -1 ? path : path.substring(lastSlashPos + 1)); System.out.println("Trying to open " + path); try { core = new MuPDFCore(this, path); // New file: drop the old outline data OutlineActivityData.set(null); Recent recent = new Recent(this); recent.add(0, mFileName); recent.commit(); } catch (Exception e) { System.out.println(e); return null; } catch (java.lang.OutOfMemoryError e) { // out of memory is not an Exception, so we catch it separately. System.out.println(e); return null; } return core; }