Created
October 13, 2019 14:36
-
-
Save harshabhadra/2555e2ff1b33a21b8663d2a98d59d006 to your computer and use it in GitHub Desktop.
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
//Get the version name | |
private String getVersionName(Context context) { | |
PackageInfo pInfo = null; | |
try { | |
pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0); | |
} catch (PackageManager.NameNotFoundException e) { | |
e.printStackTrace(); | |
} | |
return pInfo.versionName; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment