Search code examples
lwuitcodenameone

how can we fix rotation of screen in codenameone?


I am making a application in code name one, and as my requirement I want my screen fix.

like only portrait view or landscape view. How we can do it?

Please help.


Solution

  • Try Display.getInstance().canForceOrientation() and Display.getInstance().lockOrientation(boolean). Notice that not all devices support orientation locking.