I am trying to pass an ArrayList of type Album to another activity in Android Studio.
The problem is that the Lastfm API I am using does not implement Parcelable.
I tried making my own Album class and extending their Album class but I got the error
"there is no default constructor available in 'de.umass.lastfm.Album'
Quiz.java - intent.getParcel... not working as Album is not Parcelable
public class Quiz extends AppCompatActivity {
private static TextView tv_quiz;
private static EditText et_quiz;
private ArrayList<Album> albums;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
Intent intent = getIntent();
albums = intent.getParcelableArrayListExtra(MainActivity.ALBUMS_LIST);
}
}
The calling portion of my MainActivity.java.
Intent intent = new Intent(this, Quiz.class);
intent.putExtra(ALBUMS_LIST, allAlbums);
intent.putExtra(DIFFICULTY, difficulty);
startActivity(intent);
Is there any way I can get around this?
Thanks anyway