上一篇文章讲到了webview技术方面的优化(没有看到的朋友可以看看http://blog.csdn.net/fkingu007/article/details/44650031),这次进一步完善一下,主要完成状态保留工作,也是解决了我的一个疑问,下面看看如何做到的。
转载请标明文章出处 http://blog.csdn.net/fkingu007/article/details/44675129,尊重原创。
1、 activity意外被杀
上个博文已经说到了,在onSaveInstanceState(Bundle)调用webview.saveState(bundle)保存状态,在onCreate(Bundle saveInstanceState)里通过savedInstanceState == null判断,不为null,即可通过webvi