赞
踩
android:label="@string/app_name"
采用
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
int labelRes = packageInfo.applicationInfo.labelRes;
return context.getResources().getString(labelRes);
若是占位符的采用
android:label="${xxx}",采用loadlabel,兼容上面的,没有占位符的
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
return packageInfo.applicationInfo.loadLabel(packageManager).toString();
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。