aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-01-31 19:26:19 +0100
committerChristian Schneppe <christian@pix-art.de>2017-01-31 19:26:19 +0100
commit49cbd712e3ef9acedd0728298ac4da910780ee67 (patch)
tree96ef676f261255f9e20e43b16c02f2acf7cb7667 /src
parent95430627c2a5079f036220feba3603cd04f88378 (diff)
parent7aa0387ef4a48838180f6219b26ab15d99c10fc8 (diff)
Merge branch 'master' of https://github.com/kriztan/Pix-Art-Messenger
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/UpdaterActivity.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
index 548313c6c..b24958a43 100644
--- a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
@@ -162,6 +162,18 @@ public class UpdaterActivity extends Activity {
alert.show();
}
+ /**
+ * Use this instead of String.compareTo() for a non-lexicographical
+ * comparison that works for version strings. e.g. "1.10".compareTo("1.6").
+ *
+ * @note It does not work if "1.10" is supposed to be equal to "1.10.0".
+ *
+ * @param str1 a string of ordinal numbers separated by decimal points.
+ * @param str2 a string of ordinal numbers separated by decimal points.
+ * @return The result is a negative integer if str1 is _numerically_ less than str2.
+ * The result is a positive integer if str1 is _numerically_ greater than str2.
+ * The result is zero if the strings are _numerically_ equal.
+ */
private int checkVersion(String remoteVersion, String installedVersion) {
String[] remote = null;
String[] installed = null;