04-18-2010 12:38 AM
I want to avoid USB connection, so I thought using a USBPortListenner, everything its ok from now, but what function, should I use to close the connection, so it could act like avoiding usb.
This is the code I used for the listenner
import net.rim.device.api.system.IOPortListener;
import net.rim.device.api.system.USBPort;
import net.rim.device.api.system.IOPort;
import net.rim.device.api.system.*;
public final class TestUSB extends Application {
public static void main(String[] args) {
TestUSB app = new TestUSB();
app.enterEventDispatcher();
} // End main function
public TestUSB() {
addIOPortListener(new USBListenner());
}
}
public interface USBPortListener extends IOPortListener {
void connectionRequested();
}
public class USBListenner implements USBPortListener {
public void connectionRequested() {
// Here should be the method to close connection
IOPort port = new IOPort() ;
port.close();
}
}Can anyone help me out to avoid USB connection?