最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Android webview旋转屏幕导致页面重新加载问题解决办法
时间:2022-06-25 23:16:08 编辑:袖梨 来源:一聚教程网
Android webview旋转屏幕导致页面重新加载问题解决办法
1. 在create时候加个状态判断
protected void onCreate(Bundle savedInstanceState){
...
if (savedInstanceState == null)
{
mWebView.loadUrl("your_url");
}
...
}
2. 重载保存状态的函数:
@Override
protected void onSaveInstanceState(Bundle outState )
{
super.onSaveInstanceState(outState);
mWebView.saveState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState)
{
super.onRestoreInstanceState(savedInstanceState);
mWebView.restoreState(savedInstanceState);
}
相关文章
- 《Pokemon TCG》Mega Evolution - Chaos Rising 系列 Crobat 全图卡牌情报公开 04-25
- TGA年度最佳《光与影 33号远征队》销量爆炸 官宣突破八百万 04-25
- 刺客信条 黑旗记忆重置版现价格异常,豪华版短时直降10美元引热议 04-25
- 全本小说账号怎么注销 04-25
- 异环新手实用开荒建议指南 04-25
- 怎么解锁《Kiln》中的所有成就 04-25