aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2015-10-06 21:46:25 +0200
committerChristian S <christian@pix-art.de>2015-10-06 21:46:25 +0200
commit91899621905467fb9b22cf761789f9c1ce3a1f5d (patch)
tree27c7a5e228a7ef60271d56460c419fdaef9f928c /src/main/java
parent279af4c0829dd4b55b88f2e267b578559739ec7c (diff)
update Updater
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java
index 4c8b524f7..3df4dca75 100644
--- a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java
@@ -155,6 +155,17 @@ public class UpdaterActivity extends Activity {
boolean success = responseObj.getBoolean("success");
//if the reponse was successful check further
if(success){
+ //Overall information about the contents of a package
+ //This corresponds to all of the information collected from AndroidManifest.xml.
+ PackageInfo pInfo = null;
+ try {
+ pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
+ }
+ catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ //get the app version Name for display
+ String version = pInfo.versionName;
//get the latest version from the JSON string
int latestVersionCode = responseObj.getInt("latestVersionCode");
String latestVersion = responseObj.getString("latestVersion");
@@ -176,7 +187,7 @@ public class UpdaterActivity extends Activity {
builder.setCancelable(false);
String UpdateMessageInfo = getResources().getString(R.string.update_available);
- builder.setMessage(String.format(UpdateMessageInfo, changelog, latestVersion, version)
+ builder.setMessage(String.format(UpdateMessageInfo, latestVersion, changelog, version))
.setPositiveButton(R.string.update, new DialogInterface.OnClickListener() {
//if the user agrees to upgrade
public void onClick(DialogInterface dialog, int id) {