在PersistableBundle中保存WebView状态

时间:2015-02-09 13:52:47

标签: android webview

如何在WebView中保存PersistableBundle的状态?

@Override
public void onRestoreInstanceState(Bundle savedInstanceState,
        PersistableBundle persistentState) {
    webview.restoreState((Bundle)persistentState); //Error
    super.onRestoreInstanceState(savedInstanceState, persistentState);
}

@Override
public void onSaveInstanceState(Bundle outState,
        PersistableBundle outPersistentState) {
    webview.saveState(outPersistentState); //Error
    super.onSaveInstanceState(outState, outPersistentState);
}

或唯一的解决方案是在首选项中手动保存?

0 个答案:

没有答案