# Adapt screen to an orientation change

**URL:** <https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [October 27, 2011, 2:54pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243 "2011-10-27T14:54:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Gallego](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/javier_gallego/32/77_2.png) [@Javier\_Gallego](https://techcommunity.softwareag.com/u/Javier_Gallego)\
**Post date:** [October 27, 2011, 2:54pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/1 "2011-10-27T14:54:16Z")

</div>

Hi  
I have seen in the docu that there is a property to react to an screen rotation.  
project.handset.adapttoorientationchange  
Platforms BREW, iOS, Windows Mobile  
Options “true” / “false”  
Default “false”  
Set this to true if the application should rotate its display if the device’s screen is rotated. If set, the corresponding rendering

inside the graphics library will change, the values fed back from

Android should trigger a canvas rotation automatically when reading the doc for property:  
android.orientation.forced

Testing with an Android emulator I see that nothing happens  
Picture (Device Independent Bitmap) Picture (Device Independent Bitmap)

How do I catch such an event? Do I need to set additional properties for this?

Many thanks  
Javier

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 27, 2011, 4:00pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/2 "2011-10-27T16:00:26Z")

</div>

Hi Javier,

None of the NativeUI implementations currently support this - previous non-NativeUI apps would work with this fine.

It’s on the to-do list, but requires a bit of an internal discussion as there’s obviously an impact on any application that tries to lay out its display based on exact pixel positions and then is subsequently rotated.

Regards,

Nick.

---

<div class="post-metadata">

**Author:** ![Javier\_Gallego](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/javier_gallego/32/77_2.png) [@Javier\_Gallego](https://techcommunity.softwareag.com/u/Javier_Gallego)\
**Post date:** [October 27, 2011, 4:49pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/3 "2011-10-27T16:49:53Z")

</div>

hi  
when you say that pre-NativeUI apps worked fine, means that the event was captured somehow.  
Is it not possible to capture this event in a NativeUI app? I want to refresh the whole view anyway (to display some more columns in a table).

Can you say anything about when can we expect this to be ready? Screen rotation is something i (as a mobile dev beginner) would take for granted in a mobile app.

many thanks  
Javier

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 27, 2011, 4:55pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/4 "2011-10-27T16:55:10Z")

</div>

Hi Javier,

Yes, in the MIDP specification the Canvas has a simple “sizeChanged”  
event which pre-NativeUI apps could utilise and would work as required,  
and our runtime abstraction layer also dealt with. For NativeUI, the  
implications of this haven’t been implemented yet. Re. timescale, I’m  
not sure currently, but I imagine it will be one of the earlier NativeUI  
enhancements we’ll look at once things like J+ are out the way.

Regards,

Nick.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [October 27, 2011, 5:02pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/5 "2011-10-27T17:02:22Z")

</div>

Given that the documentation you pasted below indicates that it’s supported on BREW, iOS, and Windows Mobile, I would assume it wouldn’t do anything on Android anyway.

And given the complexities in rebuilding a screen with a completely different size/shape, automatic canvas rotation would require a completely different set of Windows/Views/and/or Pages to be defined.

Of course, simply having an event we could detect when the screen was rotated might be helpful regardless. But I’d expect that as part of the formal NativeUI support Nick mentions is on the roadmap.

Dave

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/adapt-screen-to-an-orientation-change/100243/6 "2021-04-02T15:01:48Z")

</div>


