2010-03-12 31 views
2

我爲黑莓開發應用程序。在Storm 1(4.7)和Storm 2(5.0)中,我需要在應用程序中禁用加速計。我希望我的應用程序不會對加速度計產生反應,但這不會影響其他應用程序。這是可能的?在黑莓風暴上禁用加速計

回答

5

有沒有方法來禁用加速度計,但你可以鎖定屏幕方向變化:

// To force portrait view in a BlackBerry API application, 
// use code like this before invoking UiApplication.pushScreen() 
int directions = Display.DIRECTION_NORTH | Display.DIRECTION_SOUTH; 
Ui.getUiEngineInstance.setAcceptableDirections(directions); 

Specifying the orientation and direction of the screen