Java 如何将数组列表分组为一个
如何将这两个数组列表合并为一个数组列表,以便它仍能在我的arrayAdapter中工作。我不记得该怎么做了Java 如何将数组列表分组为一个,java,android,arrays,android-arrayadapter,Java,Android,Arrays,Android Arrayadapter,如何将这两个数组列表合并为一个数组列表,以便它仍能在我的arrayAdapter中工作。我不记得该怎么做了 public class MyArrayAdapter extends ArrayAdapter<String>{ Context context; ArrayList<String>mtitle; ArrayList<String>mdesc; public MyArrayAdapter
public class MyArrayAdapter extends ArrayAdapter<String>{
Context context;
ArrayList<String>mtitle;
ArrayList<String>mdesc;
public MyArrayAdapter(Context c, ArrayList<String>title, ArrayList<String>desc) {
super(c, R.layout.single_row, R.id.viewtitle, title);
公共类MyArrayAdapter扩展了ArrayAdapter{
语境;
ArrayListTitle;
arraylistdesc;
公共MyArrayAdapter(上下文c、ArrayListtitle、ArrayListdesc){
super(c,R.layout.single_row,R.id.viewtitle,title);
…使用java BE类型数组列表。 比如:-
公共类JBContacts{
公共字符串strID=“”;
公共字符串strTitle=“”;
公共字符串getStrID(){
返回strID;
}
公共无效设置栏(字符串栏){
this.strID=strID;
}
公共字符串getstrtite(){
返回标准;
}
公共void setStrTitle(字符串strTitle){
this.strTitle=strTitle;
}
}
ArrayList Marraylist联系人;
JbbContacts;
mArrayListContacts=new ArrayList();
mJbContacts=新的JBContacts();
strId=mJsonObjectContacts.getString(Constants.TAG_ID);
strTitle=mJsonObjectContacts
.getString(常量.TAG_标题);
mJbContacts.setStrTitle(strtle);
public class JBContacts {
public String strID = "";
public String strTitle = "";
public String getStrID() {
return strID;
}
public void setStrID(String strID) {
this.strID = strID;
}
public String getStrTitle() {
return strTitle;
}
public void setStrTitle(String strTitle) {
this.strTitle = strTitle;
}
}
ArrayList<JBContacts> mArrayListContacts;
JBContacts mJbContacts;
mArrayListContacts = new ArrayList<JBContacts>();
mJbContacts = new JBContacts();
strId = mJsonObjectContacts.getString(Constants.TAG_ID);
strTitle = mJsonObjectContacts
.getString(Constants.TAG_TITLE);
mJbContacts.setStrTitle(strTitle);