diff --git a/src/org/torproject/android/settings/AppManager.java b/src/org/torproject/android/settings/AppManager.java index db641ae1..07330306 100644 --- a/src/org/torproject/android/settings/AppManager.java +++ b/src/org/torproject/android/settings/AppManager.java @@ -5,6 +5,7 @@ package org.torproject.android.settings; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; @@ -266,6 +267,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC appIdx++; } + Collections.sort(apps); return apps; } diff --git a/src/org/torproject/android/settings/TorifiedApp.java b/src/org/torproject/android/settings/TorifiedApp.java index 8e533212..a7868004 100644 --- a/src/org/torproject/android/settings/TorifiedApp.java +++ b/src/org/torproject/android/settings/TorifiedApp.java @@ -2,7 +2,7 @@ package org.torproject.android.settings; import android.graphics.drawable.Drawable; -public class TorifiedApp { +public class TorifiedApp implements Comparable { private boolean enabled; private int uid; @@ -115,4 +115,16 @@ public class TorifiedApp { public void setIcon(Drawable icon) { this.icon = icon; } + + @Override + public int compareTo(Object another) { + + return this.toString().compareTo(another.toString()); + } + + @Override + public String toString () + { + return getName(); + } }