You must use the WebView.saveState (Bundle state) method in your onSaveInstanceState (Bundle outState) method, and then restore the state using WebView.restoreState (Bundle state) in your onActivityCreated (Bundle savedInstanceState) method
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); mWebView.saveState(outState); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mWebView.restoreState(savedInstanceState); }
Also remember the fragment life cycle. If you don't know where to restore the state (onCreate, onCreateView, onActivityCreated), take a look at the fragment fragmentation documentation to find out the right place. http://developer.android.com/guide/components/fragments.html

onCreate ()
The system calls this when the fragment is created. As part of your implementation, you must initialize the main components of the fragment that you want to keep when the fragment is paused or stopped, and then resumed.
onCreateView ()
The system calls this when the time for the fragment first displays its user interface. To draw a user interface for your fragment, you must return the view from this method, which is the root of the fragment layout. You can return null if the fragment does not provide a user interface.
onActivityCreated ()
Called when a fragment operation has been created and this fragment view hierarchy has been created. It can be used to perform the final initialization after these parts are in place, for example, to obtain representations or restore state. It is also useful for fragments that use setRetainInstance (boolean) to save their instance, as this callback tells the fragment when it is fully associated with the new activity instance. This is called after onCreateView (LayoutInflater, ViewGroup, Bundle) and before onStart ().
source share