查看本应用的应用名称 :
getString(R.String.app_name);
查看其它应用的应用名称 :
public static String getApplicationNameByPackageName(Context context, String packageName) {
PackageManager pm = context.getPackageManager();
String Name ;
try {
Name=pm.getApplicationLabel(pm.getApplicationInfo(packageName,PackageManager.GET_META_DATA)).toString();
} catch (PackageManager.NameNotFoundException e) {
Name = "" ;
}
return Name
;}
网友评论