Open pdf, doc, ppt or xls on a BlackBerry -
how open pdf, doc, ppt or xls programmatically on blackberry?
the best approach purchase 3rd-party viewer , launch view document:
string path = "file://sdcard/info.doc"; string contenttype = mimetypeassociations.getmimetype(path); invocation invocation = new invocation(path, contenttype, null, false, contenthandler.action_open); registry registry = registry.getregistry(myapp.class.getname()); try { contenthandler[] handlers = registry.findhandler(invocation); if (handlers != null && handlers.length > 0) { invocation.setid(handlers[0].getid()); registry.invoke(invocation); } else { dialog.alert("error"); } } catch (exception e) { dialog.alert("error"); }
Comments
Post a Comment