public static String getVersionName(Context context) { try { PackageManager packageManager = context.getPackageManager(); PackageInfo packageInfo = packageManager.getPackageInfo( context.getPackageName(), 0); return packageInfo.versionName; } catch (NameNotFoundException e) { e.printStackTrace(); } return null; }
中级程序员
by: ︿彼岸の幸福丿ˊ 发表于:2014-11-25 23:02:59 顶(1) | 踩(0) 回复
效果是什么?
回复评论