Created
August 7, 2014 13:19
-
-
Save darwind/b4ba332a0ecac9c434da to your computer and use it in GitHub Desktop.
Gets the versioncode of the current app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public int getVersionCode() { | |
| int versionCode = 0; | |
| try { | |
| versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; | |
| } catch (PackageManager.NameNotFoundException e) { | |
| // Huh? Really? | |
| } | |
| return versionCode; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment