Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 83
Registered: ‎05-24-2011
My Device: Storm 9550
My Carrier: XXX
Accepted Solution

FileSystemRegistry.listRoots() returns null on blackberry device 9300

I am trying to get the path the the SDCard in my blackberry application, and when I run this code:

sdCardPresent = false;
String root = null;
Enumeration e = FileSystemRegistry.listRoots();
while (e.hasMoreElements())
{
     root = (String)e.nextElement();
     if(root.equalsIgnoreCase("sdcard/"))
     {
          sdCardPresent = true;
     }     
}

 on a Blackberry 9300 device, the line Enumeration e = FileSystemRegistry.listRoots(); returns null. I have tested this on two different 9300, both with SDCards, and the result is the same. The code works on other test devices, and on simulators. Any one run into this issue in the past?

Highlighted
Regular Contributor
Posts: 83
Registered: ‎05-24-2011
My Device: Storm 9550
My Carrier: XXX

Re: FileSystemRegistry.listRoots() returns null on blackberry device 9300

Nevermind, I solved it. It was because I had the nerve to try to actually debug on the device and have it connected to the computer. I pulled the plug and it worked.