Force blackberry game to always use landscape mode
I am porting a game from j2me to blackberry. In j2me there is a way to change orientation. but I don't know how to do it in blackberry. If I am using
net.rim.device.api.ui.Ui.getUiEngineInstance().setAcceptableDirections(Display.DIREC开发者_开发问答TION_PORTRAIT);
Its giving error. Please guide me.
Thanks in advanceI think you shouldn't call the setAcceptableDirections
method before you enter the event dispatcher. Here's what i did in my Screen
and it works:
protected void onUiEngineAttached(boolean attached) {
super.onUiEngineAttached(attached);
Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT);
}
精彩评论