Friday, 27 September 2013

Sort ArrayList by any column and "print" result

Sort ArrayList by any column and "print" result

I filled array list with values. Each row is item with properties. Now I
would like to sort items by one of properties and "print" them to
textview.
ArrayList<String[]> arrayList = new ArrayList<String[]>();
final String[] rowToArray = new String[7];
rowToArray[0] = itemName;
rowToArray[1] = itemProperties1;
rowToArray[2] = itemProperties2;
rowToArray[3] = itemProperties3;
rowToArray[4] = itemProperties4;
rowToArray[5] = itemProperties5;
rowToArray[6] = itemProperties6;
arrayList.add(rowToArray);
Could you please help me to sort it by properties and then show me how to
print item one by one with properties.
Thank you in advance.

No comments:

Post a Comment