Android WebView Save State

谁说我不能喝 提交于 2019-12-20 03:55:22

问题


I have an app with a WebView. There is a page with Upload Photo button so I use the openFileChooser. Sometimes I have a problem when the camera is chosen. The activity restarts and the webview is back on the beginning. How I can save the state of the activity? Please give an example (I saw that a good example of this would be useful).


回答1:


You can save the Webview in Android Cache : Use WebView Setting :

webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

This will help you ..happy codeing



来源:https://stackoverflow.com/questions/24789299/android-webview-save-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!