How can I pass an object of a custom type from one Activity to another using the
putExtra()
method of the class Intent?
Short answer for fast need
1. Implement your Class to Serializable.
If you have any inner Classes don't forget to implement them to Serializable too!!
public class SportsData implements Serializable
public class Sport implements Serializable
List clickedObj;
2. Put your object into Intent
Intent intent = new Intent(SportsAct.this, SportSubAct.class);
intent.putExtra("sport", clickedObj);
startActivity(intent);
3. And receive your object in the other Activity Class
Intent intent = getIntent();
Sport cust = (Sport) intent.getSerializableExtra("sport");