Return true

 

Here, we load a simple Web page into the browser () that consists of the current time, made into a hyperlink to the URL. We also attach an instance of a subclass, providing our implementation of . In this case, no matter what the URL, we want to just reload the via .

Running this activity gives the result shown in Figure 13‑3.

Figure 13‑3. The Browser3 sample application

Selecting the link and clicking the D‑pad center button will “click” the link, causing us to rebuild the page with the new time.

 

Settings, Preferences, and Options (Oh, My!)

 

With your favorite desktop Web browser, you have some sort of “settings” or “preferences” or “options” window. Between that and the toolbar controls, you can tweak and twiddle the behavior of your browser, from preferred fonts to the behavior of Javascript.

Similarly, you can adjust the settings of your widget as you see fit, via the instance returned from calling the widget’s method.

There are lots of options on to play with. Most appear fairly esoteric (e.g., ). However, here are some that you may find more useful:

• Control the font sizing via (to use a point size) or (to use constants indicating relative sizes like and )

• Control via (to disable it outright) and (to merely stop it from opening pop‑up windows)

• Control Web site rendering via – 0 means the gives the Web site a user‑agent string that indicates it is a mobile browser, while 1 results in a user‑agent string that suggests it is a desktop browser

The settings you change are not persistent, so you should store them somewhere (such as via the Android preferences engine) if you are allowing your users to determine the settings, versus hard‑wiring the settings in your application.

 

 








Дата добавления: 2015-05-16; просмотров: 786;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.003 сек.