I need to pass to a secondary activity an object defined as:
public class Campionati extends ArrayList<Campionato> implements Serializable {
I'm able to create an extra containing the object. In the onCreate() function of the secondary activity I go to retrieve the data by the code:
Bundle b = getIntent().getExtras();
if (b!=null) {
Serializable s = b.getSerializable("datiSport");
Campionati m_campionati = (Campionati)s;
Both b and s objects are good and s is typed as ArrayList. The last command generates an exception:
Java.lang.ClassCastException: Java.util.ArrayList
What does it mean? I don't understand why the cast is not possible .