java - How to sort array object by specific string field? -


this class of object (i need timestamp string):

public class evento{     public string timestamp;      public evento(string timestamp) {         super();         this.timestamp = timestamp;     }     public string gettimestamp() {         return timestamp;     } } 

in activity have:

evento evento = new evento[10]; for(int = 0; i<10; i++)     evento[i] = new evento(/*casual string timestamp*/); 

then have populated array, how can sort timestamp inserted?

as stated, going need custom implementation of comparator interace. since string, first convert timestamp date object: converting string timestamp date , , follow example sort date sort objects in arraylist date?


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -