Reputation: 11097
I am using a dynamic ListView which contains 3 buttons ,1 checkbox and a textview.I want that 1.) The user should be able to check only one checkbox from any row, if one is checked so other row's checkbox should be unchecked . 2.) text on button & textView is also generated dynamically via different ArrayLists so how can I use diff-2 arraylist in a single ListView.
Upvotes: 0
Views: 1250
Reputation: 40188
Craete a class E
(You can rename as you want) like this
import java.util.ArrayList;
public class E {
private ArrayList<Object> list1;
private ArrayList<Object> list2;
/**
* @param list1 the list1 to set
*/
public void setList1(ArrayList<Object> list1) {
this.list1 = list1;
}
/**
* @return the list1
*/
public ArrayList<Object> getList1() {
return list1;
}
/**
* @param list2 the list2 to set
*/
public void setList2(ArrayList<Object> list2) {
this.list2 = list2;
}
/**
* @return the list2
*/
public ArrayList<Object> getList2() {
return list2;
}
}
Now here is your ArrayList
which uses multiple ArrayList
ArrayList<E> custom=new ArrayList<E>();
Hope this will help you.
Upvotes: 1
Reputation: 3936
Merge the two ArrayLists into a single ArrayList and set it as the adapter.
Upvotes: 0