2

我为黑莓开发应用程序。在 Storm 1 (4.7) 和 Storm 2 (5.0) 中,我需要在我的应用程序中禁用加速度计。我希望我的应用程序不对加速度计做出反应,但这不会影响其他应用程序。这是可能的?

4

1 回答 1

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);

请参阅指定屏幕的方向和方向

于 2010-03-12T13:07:41.643 回答