title: Sort ArrayList<String[]> by any column and "print" result
body: <p>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.</p>
  
  <pre><code>ArrayList&lt;String[]&gt; arrayList = new ArrayList&lt;String[]&gt;();
  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);
  </code></pre>
  
  <p>Could you please help me to sort it by properties and then show me how to print item one by one with properties.</p>
  
  <p>Thank you in advance.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>SOLVED BY <a href="https://stackoverflow.com/users/1667004/ppeterka-66">ppeterka66</a></strong></p>
  
  <p>I just had to add his code and call <strong>Collections.sort(arrayList,new StringArrayComparator(column));</strong> where column is required column to be sortby.</p>
  
  <pre><code>int i=0;
  final int column=2;
  Collections.sort(arrayList,new StringArrayComparator(column));
  for(String[] line :arrayList) 
      {
      Log.d(Integer.toString(i),line[column].toString());
      }
  </code></pre>