Google

Figure 7.2: Viewing a web page with the default browser

The next line creates a new Intent class with an action of ACTION_VIEW, passing it the Uri class just created as the object we want to view. Finally, we call the startActivity() method to request that this action be performed.

When the Browser activity starts, it will create its own view (see Figure 7.2), and your program will be paused. If the user presses the Back key at that point, the browser window will go away, and your application will continue. But what if you want to see some of your user interface and a web page at the same time? Android allows you to do that by using the WebView class.

0 0

Post a comment