When I'm trying to pass an intent from one activity to another my app crashes, without the putExtra() it works fine.
Here's my snippet from the first activity
ArrayList<Subject> subjectList = new ArrayList<Subject>();
public void computeGrades(View view){
Intent intent = new Intent(this, JLCSActivity2B.class);
intent.putExtra("subjectList", subjectList);
startActivity(intent);
}
The Second Activity
public class JLCSActivity2B extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
Intent intent = getIntent();
ArrayList<Subject> subjectList = (ArrayList<Subject>) intent.getSerializableExtra("subjectList");
}
}