Created
April 13, 2018 11:30
-
-
Save erfanegtfi/1bfef7cead5b28ff97aff912d5b2c79f to your computer and use it in GitHub Desktop.
getAppVersionName
This file contains 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 static String getAppVersionName() { | |
try { | |
return MyApplication.getContext().getPackageManager().getPackageInfo(MyApplication.getContext().getPackageName(), 0).versionName; | |
} catch (Exception ex) { | |
ex.printStackTrace(); | |
return "1"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment