Challenge: Supporting Non-HTTP Links
If you poke around within PhotoPageFragment’s WebView, you may stumble upon non-HTTP links. For example, as of this writing, the photo detail page Flickr provides displays an Open in App button. Pressing this button is supposed to launch the Flickr app if it is installed. If it is not installed, the Google Play store should launch and offer the option to install the Flickr app.
However, if you press Open in App, the WebView instead displays error text, as shown in Figure 28.4.
Figure 28.4 Open in app error
This is because you overrode WebViewClient.shouldOverrideUrlLoading(…) to always ...
Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.