public static String getVersion(Context context) {
String version = null;
try {
PackageInfo i = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
version = i.versionName;
} catch (PackageManager.NameNotFoundException e) {
}
return version;
}
'android' 카테고리의 다른 글
SharedPreferences (0) | 2019.04.08 |
---|---|
앱 이름 가져오기 (0) | 2019.04.08 |
JSON String 파싱하기 (0) | 2019.03.20 |
안드로이드 UI 라이브러리 모음 (0) | 2019.03.05 |
setDisplayShowCustomEnabled 뒤로 가기 색상 변경 (0) | 2018.10.30 |