I have a FragmentPagerAdapter used to show about 6 tabs, all of which load their data from a web server. One of the tabs contains a WebView that loads an image from my server. <
The problem appears to be that you are wiping out your own results.
While you need a new WebView
on a configuration change, you do not need a new WebView
otherwise. And, if you already have the WebView
, you do not have to tell it to do anything.
So, I'd try this:
WebView
that you create in onCreateView()
in a data member of the fragmentonCreateView()
if that data member is null
loadUrl()
if you inflated the layout(if you are creating the WebView
in Java code, replace "inflate the layout" with "create the WebView
via its constructor")
If the contents of the fragment is more than the WebView
, you will also need to hold onto the root view that you inflated in a data member, so you can return that from onCreateView()
.