Beispiel #1
0
  public static Bundle bundleAlbum(Album album) {
    Bundle bundle = new Bundle();
    bundle.putInt(ALBUM_ID, album.getId());
    bundle.putString(ALBUM_GENRE, album.getGenre());
    bundle.putString(ALBUM_ARTIST, album.getArtist());
    bundle.putString(ALBUM_TITLE, album.getTitle());
    bundle.putDouble(ALBUM_PRICE, album.getPrice());

    return bundle;
  }
Beispiel #2
0
  public static Album unBundleAlbum(Bundle albumBundle) {
    Album album = new Album();
    album.setId(albumBundle.getInt(ALBUM_ID));
    album.setGenre(albumBundle.getString(ALBUM_GENRE));
    album.setArtist(albumBundle.getString(ALBUM_ARTIST));
    album.setTitle(albumBundle.getString(ALBUM_TITLE));
    album.setPrice(albumBundle.getDouble(ALBUM_PRICE));

    return album;
  }