Vla*_*lev 2 blackberry accelerometer blackberry-storm
我为Blackberry开发应用程序.在Storm 1(4.7)和Storm 2(5.0)中,我需要在我的应用程序中禁用加速度计.我希望我的应用程序不会对加速度计做出反应,但这不会影响其他应用程序.这是可能的?
无法禁用加速计,但您可以锁定屏幕方向更改:
// 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);
Run Code Online (Sandbox Code Playgroud)
请参阅指定屏幕的方向和方向