Chapter 6Displaying Pictures and Menus with Views
In the previous chapter, you learned about the various views that you can use to build the user interface of your Android application. This chapter continues your exploration of the other views that you can use to create robust and compelling applications.
In particular, you find out how to work with views that enable you to display images. Also, you see how to create option and context menus in your Android application. This chapter ends with a discussion of some helpful views that enable users to display the current time and web content.
USING IMAGE VIEWS TO DISPLAY PICTURES
So far, all the views you have seen are used to display text information. However, you can use the ImageView
, ImageSwitcher
, and GridView
views for displaying images.
The following sections discuss each view in detail.
ImageView View
The ImageView
is a view that shows images on the device screen. The following Try It Out shows you how to use the ImageView
view to display an image.
Get Beginning Android Programming with Android Studio, Fourth 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.