Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid WebView - orientation change after form submitted with POST
    primarykey
    data
    text
    <p>I have developed android application. It opens HTML page which contains a POST form with one field. Here is it's HTML:</p> <pre><code>&lt;form method="post"&gt; &lt;input name="key" type="text"&gt; &lt;input type="submit"&gt; &lt;/form&gt; </code></pre> <p>I have followed suggestions from this <a href="https://stackoverflow.com/questions/8640501/how-to-fix-rotation-on-webview-for-android-phones">post</a> to properly store/restore WebView state while device orientation change and it works properly in most cases except following:</p> <p>Step 1. When I run this application</p> <p>Step 2. Populate form</p> <p>Step 3. Submit form</p> <p><a href="https://24f32520-a-62cb3a1a-s-sites.googlegroups.com/site/ashvedandroiddevelopment/android-webview---orientation-change-after-form-submitted-with-post/step4.png?attachauth=ANoY7cq3NwXDMjqwts21ZCfuMFpOv32Nx6slIy2zDUpryMBcvnC8UpLs00czc8QGXcYYSAYSq_k7EqwJpNvhhc14V9gMtHcxE1khWUqmHC2HhNdlfoPz822eGkYJCixbY_FWziBd-LKp0PStBXvW0_fr-5E4uXZybYdHAulDphFEzIV5PqpnjK5m6FITfX9KQqWYu5BBTcXBC-TBb1Rblzsl4nSBq-x11Mkm8wIwG9Qq4gruPx90ByqlSH92ef_JvrYGTnaYbmX-gU0xRzSEZwvDxH7O2ELdCGrymbSpDMT78Yx9YUR7TKC6eooywBGKEVENgY1WT7Bz&amp;attredirects=0" rel="nofollow noreferrer">Step 4</a>. Change orientation of my device</p> <p>I get <strong>Web Page Not available</strong> massage. Instead of just display restored WebView. Am I missing something in my activity or in some configs to make WebView properly change orientation after form was submitted with POST ?</p> <p>Thanks in Advance:</p> <p>P.S. </p> <p>Here is are methods of my activity</p> <pre><code> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); preferences = PreferenceManager.getDefaultSharedPreferences(this); webView = (WebView) findViewById(R.id.webview); if (savedInstanceState != null) { webView.restoreState(savedInstanceState); } else { loadPage(); } } private void loadPage() { String url = preferences.getString(PrefsActivity.WOW_APP_URL, PrefsActivity.DEFAULT_URL); webView.loadUrl("http://192.168.1.101:8080/wow66/orientation.jsp"); } @Override public void onSaveInstanceState(Bundle savedInstanceState) { webView.saveState(savedInstanceState); super.onSaveInstanceState(savedInstanceState); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); webView.restoreState(savedInstanceState); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload