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.

  1. Open the ShopActivity Java source file in an editor or IDE.
  2. In the onCreate method, ensure that the main.xml layout resource is being set as the content view for the ShopActivity:
    setContentView(R.layout.main);
    
  3. Fetch the application resources and invoke a new setAlbum method with the contents of your favorite music album:
    Resources resources = getResources(); setAlbum(new ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.