Книга: Beginning Android

Navigating the Waters

Navigating the Waters

As previously mentioned, there is no navigation toolbar with the WebView widget. This allows you to use it in places where such a toolbar would be pointless and a waste of screen real estate. That being said, if you want to offer navigational capabilities, you can, but you have to supply the UI.

WebView offers ways to perform garden-variety browser navigation, including the following:

• reload() to refresh the currently-viewed Web page

• goBack() to go back one step in the browser history, and canGoBack() to determine if there is any history to go back to

• goForward() to go forward one step in the browser history, and canGoForward() to determine if there is any history to go forward to

• goBackOrForward() to go backward or forward in the browser history, where a negative number as an argument represents a count of steps to go backward, and a positive number represents how many steps to go forward

• canGoBackOrForward() to see if the browser can go backward or forward the stated number of steps (following the same positive/negative convention as goBackOrForward())

• clearCache() to clear the browser resource cache and clearHistory() to clear the browsing history

Оглавление книги

Генерация: 0.292. Запросов К БД/Cache: 3 / 1
Вверх Вниз