Calvin's Tech Space

          成于堅忍,毀于浮躁

             :: 首頁 :: 聯系 :: 聚合  :: 管理
          I call WebView.clearHistory(), but I am still able to go back after
          doing so. I want to reuse a WebView, but I don't want the back button
          to allow the user to go back further than the current "session" of
          using the WebView. Anybody know what is the best way to handle this? I
          thought for sure that clearHistory() would do it.

          I recently had the same issue. What I found is that you have to clear
          history AFTER the (first) page loads. It appears that the history
          clears everything before the current page so if your browser is at
          page "A", you clear history and navigate to page "B" your history will
          be "A" "B", not just "B", but if you clear history when "B" finishes
          loading you will have only "B".
          In my case I end up using "onPageFinished" method of the
          WebViwClient, but in this case you have to know what your start page
          is and clear the history only after it otherwise you will be clearing
          the history after every page navigated after the first.
          Stefan
          posted on 2010-06-09 13:53 calvin 閱讀(1607) 評論(1)  編輯  收藏 所屬分類: Android

          Feedback

          # re: WebView.clearHistory()問題 2011-12-16 11:24 Gitar
          I get it.Thank you very much!  回復  更多評論
            

          主站蜘蛛池模板: 托里县| 方城县| 乐至县| 海林市| 孟连| 武夷山市| 民县| 邛崃市| 旅游| 南京市| 什邡市| 汉寿县| 定日县| 陆川县| 平远县| 永平县| 金阳县| 肇庆市| 武平县| 吉林省| 文化| 潞西市| 东乡县| 达尔| 凤庆县| 上蔡县| 汪清县| 略阳县| 鸡西市| 亚东县| 临猗县| 陕西省| 徐水县| 盱眙县| 永平县| 桃园市| 屯留县| 明光市| 珠海市| 丹棱县| 沾益县|