Q:

Android. WebView reset on rotate

I'm making my own android app some people using my app says the app resets on rotate. But I cannot figure out whats wrong? I'm pretty new to app development thanks for the help!
App Mainactivity.java
package com.danielchr.hukeplan;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {
    private WebView wb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        wb = (WebView) findViewById(R.id.webView);
        WebSettings webSettings = wb.getSettings();
        webSettings.setJavaScriptEnabled(true);
        wb.loadUrl("https://www.hukeplan.com/");
        wb.setWebViewClient(new WebViewClient());
        if (savedInstanceState != null) {
            wb.restoreState(savedInstanceState);
        } else {
            wb.loadUrl("https://hukeplan.com");
        }

    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        wb.saveState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle state) {
        super.onRestoreInstanceState(state);
    }

    @Override
    public void onBackPressed() {
        if (wb.canGoBack()) {
            wb.goBack();
        } else {
            super.onBackPressed();
        }
    }

}

I don't know how to fix the rotate problem.

A:

if you want to show the WebView in only portrait mode than you may write this in your 

android:screenOrientation="portrait"

or you may write below in your  tag in your AndroidManifest
android:configChanges="keyboardHidden|orientation|screenSize"

This will prevent activity from loading again on orientation changes
or you may also override this method in your activity to handle orientation changes.
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
}

