My Webview Reloads When I Change From Portrait To Landscape

后端 未结 7 924
刺人心
刺人心 2021-01-01 17:25

I have a simple WebView that runs a web application on an Android. The problem is when I rotate the phone to change it to landscape the webview rel

7条回答
  •  星月不相逢
    2021-01-01 18:14

    Beginning with Android 3.2 (API level 13), the "screen size" also changes when the device switches between portrait and landscape orientation. Thus, if you want to prevent runtime restarts due to orientation change when developing for API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), you must include the "screenSize" value in addition to the "orientation" value. That is, you must decalare

    
    

    Here's the docs: http://developer.android.com/guide/topics/resources/runtime-changes.html

提交回复
热议问题