Android webview untold stories

Source: Internet
Author: User

Without any doubts, Android SDK has a poor documentations. There are pitfalls and traps about APIs without any mentions In SDK documentations.

1. webview. clearhistory ()

When there is only one item in webview's internal back/forward list, clearhistory () won't clear anything. when there are more than one items in back/forward list, clearhistory () will clear all the items before t the top one, or the current one.

The next question you might ask is when webview adds an item to its back/forward list when loading a URL. by listening webchromeclient. onprogresschanged (), we can know this, when new progress is bigger than 10, the loading URL will be added to its back/forward list. so when new progress is bigger than 10, loading URL becomes current item and thus you can clear previous loaded URLs by calling clearhistory ().

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.