Time for action - developing the main user interface Java code
In order to put this example together entirely and have a working content-centric screen (although only in the example sense), we need some Java code. This code will handle populating the user interface layout with an
Album object. For this next piece of code, you'll need images for the cover art and for the artist's logo.
- Open the
ShopActivityJava source file in an editor or IDE.
- In the
onCreatemethod, ensure that the
main.xmllayout resource is being set as the content view for the
- Fetch the application resources and invoke a new
setAlbummethod with the contents of your favorite music album:
Resources resources = getResources(); setAlbum(new ...