0

I have a webapp that is converted into a mobile app (Android) via Jasonette.
When I change the orientation of the device, e.g. from portrait to landscape, this causes the page to reload.
This does not happen in my web-app.

Is there a way to prevent the page reload in the mobile app, when changing the orientation of the device?

Thanks

Avner Moshkovitz
  • 1,138
  • 1
  • 18
  • 35

2 Answers2

0

Never used jasonette before (though heard of it), but it may happen due to screen redrawing when orientation changes. It's common for mobile devices.

So you need to somehow preserve state of your page before screen rotates, and then restore it after. Can jasonette do it?

More crude variant: just restrict your screen orientation to horizontal or vertical only in the native app settings (in AndroidManifest.xml for Android, via XCode or in Info.plist for iPhone).

Som-1
  • 601
  • 7
  • 16
0

I solved the problem by following this link and setting

cat AndroidManifest.xml
...
android:configChanges="keyboardHidden|orientation|screenSize"

After doing this, changing the orientation re-renders the page according to the orientation without reloading the page (see snapshot1)

snapshot1

p.s. setting android:screenOrientation="landscape" also fixes the reloading problem but restricts the orientation to landscape (see snapshot2).

snapshot2

Avner Moshkovitz
  • 1,138
  • 1
  • 18
  • 35