如何从包名中获取应用程序的名称。我不想要我的应用程序的名称。这是我的代码:
String packName ="com.apphousebd.ramadan2017";
final PackageManager pm = getApplicationContext().getPackageManager();
ApplicationInfo ai;
try {
ai = pm.getApplicationInfo( packName, 0);
} catch (final NameNotFoundException e) {
ai = null;
}
final String applicationName = (String) (ai != null ? pm.getApplicationLabel(ai) : "(unknown)");