My ArrayList contains has two records:
Item 1
Item 2
Here is the loop I am using to get these records
String global = null;
for(int i=0; i<arrayList.size(); i++) {
String name = arrayList.get(i).getName().toString();
}
global = global+name+", ";
Log.d("items:", global);
Output:
D/items:: nullItem 2,
Whereas I was expecting
Item 1, Item 2
global = global + ", " +arrayList.get(i).getName().toString();inside a loop