Tuesday, February 1, 2011

[android-developers] Re: How to sort HashMap?

Ok, I did this but runtime error, did I do wrong?

---

public class Sortable {
private String name;
private String age;

public Sortable(){
}
public Sortable(String name, String age){
this.name = name;
this.age = age;
}

public String getName() {
return name;
}

public String getAge() {
return age;
}
}

---

ArrayList test = new ArrayList();
.
.
.
Sortable qqq = new Sortable(name, age);
ppp.add(qqq);
.
.
.
// Before I try the Collections.sort(), I have error.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment