Given a Java object that has certain fields defined such as a User class:
public class User {
public String Largetext;
public String Mediumtext;
public User(String Largetext, String Mediumtext) {
this.Largetext = Largetext;
this.Mediumtext = Mediumtext;
}
And ListView is:
String[] excercise1 = {"Wide-Grip Pull-Up", "Wide-Grip Pull-Down", "T-Bar Row", "Seated Cable Row", "Close Grip Row", "One Arm Dumble Row", "Dead Lift"};
String[] Detail = {"3 Set of 8-12 rep","4 set of 12-15 rep","3 set of 12,10,8 rep","3 set of 10-12 rep","4 set of 10-15 rep","3 set of 10-12 rep","4 set of 10,8,8,6"};
ArrayList<User> arraylist = new ArrayList<>();
final int[] imgs1 = {R.drawable.pullup_la, R.drawable.pulldown_la, R.drawable.tbar_la, R.drawable.seated_la, R.drawable.bend_la, R.drawable.onearm_la, R.drawable.dead_la};
ListAdapter saruadapter = new Backcoutomadapter(this, arraylist, imgs1);
ListView sarulistview = (ListView) findViewById(R.id.SarulistView);
sarulistview.setAdapter(saruadapter);
Now how could i merge this two array of string excercise1 and Detail to this arraylist. So i could this arraylist in Backcoutomadapter like this:
public class Backcoutomadapter extends ArrayAdapter<User> {
private int[] imgs1;
private String[] detail;
public Backcoutomadapter(Context context, ArrayList<User> excercise1, int[] imgs) {
super(context, backcustom_row, excercise1);
this.imgs1 = imgs;
}
Thanks in advance.