Issue
I see my WebView is being reloaded in many different cases: after changing orientation, after turning off/on etc.
Is there a simple way to stop reloading WebView at all? It's kinda weird, when a component does such important things on its own, instead of throwing NeedReload event or something.
Regards,
UPDATE
To beat turning screen off as well as orientation handling, do this:
- Create the view in Application.onCreate().
- Add the view to a layout in Activity.onCreate().
- Remove the view from the layout in Activity.onDestroy().
Details are here: Attach/detach Android view to/from layout
Solution
Webview content will be loaded depending on where you called your loadurl . For ex: if you written your loadurl function in onCreate() then that function will executes when orientation changes. you can restrict them in manifest file android:configChanges="orientation|keyboardHidden"
. So be sure where to call your load url function and also look at Activity life cycle
Answered By - vnshetty
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.