Search code examples
blackberryjava-mefilepicker

Blackberry open file


I use the browser to open a pdf file, but I want to use the regular file manager in order to open the file with a third party application. How do I do that?

BrowserSession page = Browser.getDefaultSession();
page.displayPage("file:///SDCard/BlackBerry"+Integer.parseInt(tab[4])+".pdf");

Solution

  • It depends on OS version. In OS 5 RIM added the net.rim.device.api.ui.picker.FilePicker class that does what you need. For pre 5 OS you have to implement your own screen to select a file from the file-system. Your local BB SDK should contain a sample app for this, search by "fileexplorerdemo" to find that sample and to see the code.