diff options
author | Christian S <christian@pix-art.de> | 2015-10-07 19:47:35 +0200 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-10-07 19:47:35 +0200 |
commit | e5519bea18c78ab089e0757d169fb040816d8ca5 (patch) | |
tree | e773a34910632296c9f575bb66bef42769b08e91 /src/main/java/eu/siacs/conversations/ui | |
parent | e76ddbaa6c74a6ec2007100d665f250a599a293e (diff) | |
parent | da02919bddae8cbefdd4c0bca43dc72c7425c6bb (diff) |
Merge branch 'Update_Startup' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java | 15 |
1 files changed, 14 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 4f43a70b8..3df4dca75 100644 --- a/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UpdaterActivity.java @@ -155,9 +155,21 @@ 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"); + String changelog = responseObj.getString("changelog"); /* //display the new version in a TextView TextView versionText = (TextView) findViewById(R.id.versionName); @@ -174,7 +186,8 @@ public class UpdaterActivity extends Activity { AlertDialog.Builder builder = new AlertDialog.Builder(UpdaterActivity.this); builder.setCancelable(false); - builder.setMessage(R.string.update_available) + String UpdateMessageInfo = getResources().getString(R.string.update_available); + 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) { |