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
New Developer
Posts: 2
Registered: ‎11-05-2009
My Device: Not Specified

Problems about set the orientaions in MIDlet

Hello,

 

I checked the doc on the internet and even the sample code in BB sdk,

it said, to set the orientaion in MIDlet, we could use code below:

 

      DirectionControl dc = (DirectionControl)((Controllable)Display.getDisplay(this)).getControl("net.rim.device.api.lcdui.control.DirectionControl");

      int directions = DirectionControl.DIRECTION_EAST;
      dc.setAcceptableScreenDirections(directions);

 

before setCurrent().

 

But I got problem with this code, the (Controllable)Display.getDisplay(this)) part,

the error message is, cannot find the symbol Controllable,

I tried to import

javax.microedition.sensor.control.Controllable;

and

javax.microedition.media.Controllable;

but both faild when I loaded cod into my 9500 with alert: Class not found.

 

So, what should I import, if I want this work to set orientation??

 

thanks.

New Developer
Posts: 2
Registered: ‎11-05-2009
My Device: Not Specified

Re: Problems about set the orientaions in MIDlet

is there anyone having the same problem as me ??