Im new to java and I saw this link here and my questions is pretty similar, but I coudln't understand how that works.
I have a ArrayList with a few variables, how I can fill this variables and pass it to a new activity? My new activity is named as Detail.java
Im creating my ArrayList as
public final List<Car> ExtraCars = new ArrayList<Car>();
so I can use in the next activity, Im not sure if is this the best way to use.
The structure of this Car is:
public Car (String make, int year, int iconID, String condition){
super();
this.make = make;
this.year = year;
this.iconID = iconID;
this.condition = condition;
}
I would like to know how to fill this ExtraCars with some random variables, like make = actualmake; and all this be passed to the Detail.java
And also to retrieve this informations on Detail.java should I do this?
Intent intent = getIntent();
String make = intent.getStringExtra(MainActivity.ExtraCars.make);