/** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    ImageAlbumDatabaseHelper databaseHelper = new ImageAlbumDatabaseHelper(getApplicationContext());
    PicasaAlbumManager albumManager = databaseHelper.getAlbumManager();

    Cursor albumCursor = albumManager.getAlbumCursor();

    // Let the activity manage the cursor so that our cursors get closed
    // when our activity is finished
    startManagingCursor(albumCursor);

    String[] columns = new String[] {PicasaAlbumManager.TITLE, PicasaAlbumManager.AUTHOR};
    int[] names = new int[] {R.id.picasaAlbumTitle, R.id.picasaAlbumAuthor};

    albumCursorAdapter =
        new AlbumCursorAdapter(this, R.layout.picasa_album_row, albumCursor, columns, names);

    ListView albumList = (ListView) findViewById(R.id.picasaAlbumList);
    albumList.setAdapter(albumCursorAdapter);
    albumList.setOnItemClickListener(this);
  }