Answers for "how to fix webview reload"

0

how to fix webview reload

STEP1:
===============================================================================
if (savedInstanceState == null)
{
  web.loadUrl(webURL);
}

STEP2:
===============================================================================
@Override
protected void onSaveInstanceState(Bundle outState )
{
super.onSaveInstanceState(outState);
web.saveState(outState);
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState)
{
super.onRestoreInstanceState(savedInstanceState);
web.restoreState(savedInstanceState);
}

STEP3:
===============================================================================
Note: Please also add in your AndroidManifest.xml in your Activity 
android:configChanges="orientation|screenSize" 
Thanks
Posted by: Guest on October-13-2020

Browse Popular Code Answers by Language