Store version code

This commit is contained in:
seven332 committed 2016-03-11 16:14:55 +08:00
1 parent 4aa21bab09
commit 50245bb13f
2 files changed
+21

No files matched your search

@@ -18,6 +18,8 @@ package com.hippo.ehviewer;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.os.Debug;
import android.support.annotation.NonNull;
@@ -89,6 +91,14 @@ public class EhApplication extends SceneApplication {
Analytics.start(this);
}
// Update version code
try {
PackageInfo pi= getPackageManager().getPackageInfo(getPackageName(), 0);
Settings.putVersionCode(pi.versionCode);
} catch (PackageManager.NameNotFoundException e) {
// Ignore
}
if (DEBUG_NATIVE_MEMORY) {
debugNativeMemory();
}