In the activity A, I have built an array q1 of Question and I passed to activity B:
Intent i = new Intent(getApplicationContext(), B.class);
i.putExtra("questions", q1);
startActivity(i);
finish();
In the activity B:
Object c= getIntent().getExtras().getSerializable("questions");
Now, how can I reconvert "c" in an array of Questions? I can not make a cast (Question[])
Serializable?Question[]is not a generic array. If you really meanQuestion[], then please change the title.codeQuestion[] q= (Question[]) getIntent().getExtras().getSerializable("questions");Generates: 07-31 12:25:00.657: E/AndroidRuntime(25735): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.studentteech/com.example.studentteech.Domanda}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to com.example.studentteech.Question[]