One of webview reload page after change screen orientation
<p>First code:</p>

<pre><code>package com.fshare.zsee;


public class ZSEEActivity extends TabActivity {
private WebView webview ; 
private WebView webviewtwo;
private TabHost mTabHost;
private WebSettings webviewtwoSettings;
private int error;


protected void onStart() {
    super.onStart();
    // The activity is about to become visible.
}
protected void onStop() {
    super.onStop();
    // The activity is about to become visible.
}
protected void onRestart() {
    super.onRestart();
}
protected void onDestroy(){
    super.onDestroy();
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final Activity activity = this;


    mTabHost = getTabHost();

    mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("Zastępstwa").setContent(R.id.tab1));
    mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("Plan Lekcji").setContent(R.id.tab2));
    mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("O programie").setContent(R.id.tab3));



    webview = (WebView) findViewById(R.id.webView1);
    webviewtwo = (WebView) findViewById(R.id.webView2);
    webviewtwoSettings = webviewtwo.getSettings();
        if (savedInstanceState != null){
            error = savedInstanceState.getInt("webtwoerror");
            webview.restoreState(savedInstanceState.getBundle("stateone"));
            webviewtwo.restoreState(savedInstanceState.getBundle("statetwo"));
            if(error == 1){
                webviewtwoSettings.setTextSize(TextSize.NORMAL);
            }
            else{
                webviewtwoSettings.setTextSize(TextSize.LARGER);    
            }
            mTabHost.setCurrentTab(savedInstanceState.getInt("CURRENT_TAB"));

        }
        else{
            webviewtwoSettings.setTextSize(TextSize.LARGER);
            webview.loadUrl("http://zsee.bytom.pl/ogloszenia.php");
            webviewtwo.loadUrl("http://zsee.bytom.pl/plannew/index.html");
            //error = 0 ;
            mTabHost.setCurrentTab(0);
        }

    webview.setWebViewClient(new WebViewClient() {
           public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
               String summary = "&lt;html&gt;&lt;body&gt;&lt;meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" &gt;&lt;center&gt;Coś się zepsuło :(&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;";
               webview.loadData(summary, "text/html","utf-8");
             Toast.makeText(activity, "O nie! " + description, Toast.LENGTH_SHORT).show();
           }
         });

    webviewtwo.setWebViewClient(new WebViewClient() {
       public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
           webviewtwoSettings.setTextSize(TextSize.NORMAL);
           String summary = "&lt;html&gt;&lt;body&gt;&lt;meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" &gt;&lt;center&gt;Coś się zepsuło :(&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;";
           webviewtwo.loadData(summary, "text/html","utf-8");
         Toast.makeText(activity, "O nie! " + description, Toast.LENGTH_SHORT).show();
         error = 1 ;
       }
     });

    }
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);
    return true;
}
@Override     
public boolean onKeyDown(int keyCode, KeyEvent event) 
 {         
   if (keyCode == KeyEvent.KEYCODE_BACK) 
      {            
    // put your stuff here or just block the back button for perticular activity             
         Intent i = new Intent();
        i.setAction(Intent.ACTION_MAIN);
        i.addCategory(Intent.CATEGORY_HOME);
        this.startActivity(i);     
      }         
    return super.onKeyDown(keyCode, event); 
  }


protected void onSaveInstanceState(Bundle outState) {
    Bundle outStateone = new Bundle();
    Bundle outStatetwo = new Bundle();
    webview.saveState(outStateone);
    webviewtwo.saveState(outStatetwo);


    outState.putBundle("stateone", outStateone);
    outState.putBundle("statetwo", outStatetwo);
    outState.putInt("CURRENT_TAB", mTabHost.getCurrentTab());
    outState.putInt("webtwoerror", error);
}



public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
    case R.id.item1:
        final AlertDialog alertdialog= new AlertDialog.Builder(this).create();
        alertdialog.setTitle("O Programie");
        alertdialog.setMessage("Zmiany w 1.0.1: \n-Obsługa planu z dnia 17.10.2011\n-Drobne Poprawki");
        alertdialog.setButton("Fajno", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                alertdialog.cancel();
           }
       });
        alertdialog.show();
        return true;
    case R.id.item2:
        finish();
    case R.id.item3:
        if(mTabHost.getCurrentTab() == 0){
        webview.loadUrl("http://zsee.bytom.pl/ogloszenia.php");
        }
        else if(mTabHost.getCurrentTab() == 1)
        {
        error = 0 ;
        webviewtwo.loadUrl("http://zsee.bytom.pl/plannew/index.html");
        webviewtwoSettings.setTextSize(TextSize.LARGER);
        }
    default:
        return super.onOptionsItemSelected(item);
    }
}
}
</code></pre>

<p>And now very simple question. Why webviewtwo reload page after change orientation and webview (webView1) doesen't ? and how to prevent it? Now only webView1 doesen't reload page after change screen orientation.</p>

<p>Sierran</p>
