I’m trying to pass a List
of items from one Activity
to another but I keep getting this error:
no instance(s) of type variable(s) exist so that PlaylistItem conforms
to List
List<PlaylistItem> playlists = new ArrayList<>();
Intent intent = new Intent(this, MyApp.class);
Bundle bundle = new Bundle;
bundle.putSerializable("playlists", (Serializable) playlists);
intent.putExtras(bundle);
startActivity(intent);
public class MyApp extends Activity {
protected void onCreate(Bundle savedInstanceState) {
List<PlaylistItem> playlistItems = getIntent().getSerializableExtra("playlists", PlaylistItem.class);
}
}