@Test public void testGetAppLabel() throws Exception { final String label = AppHelper.getAppLabel(getTargetContext()); assertNull(label); }
public static String getAppLabel(Context context) { String applicationName = UNKNOWN_APP; try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0); if (ai != null) { applicationName = (String) pm.getApplicationLabel(ai); } } catch (final NameNotFoundException e) { Dbg.printStackTrace(e); } return applicationName; }
AppHelper { public static String getAppLabel(Context context) { String applicationName = UNKNOWN_APP; try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0); if (ai != null) { applicationName = (String) pm.getApplicationLabel(ai); } } catch (final NameNotFoundException e) { Dbg.printStackTrace(e); } return applicationName; } }
AppHelper { public static String getAppLabel(Context context) { String applicationName = UNKNOWN_APP; try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0); if (ai != null) { applicationName = (String) pm.getApplicationLabel(ai); } } catch (final NameNotFoundException e) { Dbg.printStackTrace(e); } return applicationName; } private  AppHelper(); }
AppHelper { public static String getAppLabel(Context context) { String applicationName = UNKNOWN_APP; try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0); if (ai != null) { applicationName = (String) pm.getApplicationLabel(ai); } } catch (final NameNotFoundException e) { Dbg.printStackTrace(e); } return applicationName; } private  AppHelper(); static void debugPrintSignatures(Context context); static int getSignaturesHashCode(Context context); static String getAppLabel(Context context); static String getAppVersion(Context context); static int getAppVersionCode(Context context); static int getApkAppVersionCode(Context context, String apkFullPath); static PackageInfo getPackageInfo(Context context); static String getPackageNameFromApk(Context context, String fileName); static long getApkBuildDate(Context context); static boolean isAppInstalledToSDCard(Context context); static void removeApplication(Context context, String pkgName); static void installApplication(Context context, File file); static boolean isPackageExisted(Context context, String targetPackage); }
AppHelper { public static String getAppLabel(Context context) { String applicationName = UNKNOWN_APP; try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(context.getPackageName(), 0); if (ai != null) { applicationName = (String) pm.getApplicationLabel(ai); } } catch (final NameNotFoundException e) { Dbg.printStackTrace(e); } return applicationName; } private  AppHelper(); static void debugPrintSignatures(Context context); static int getSignaturesHashCode(Context context); static String getAppLabel(Context context); static String getAppVersion(Context context); static int getAppVersionCode(Context context); static int getApkAppVersionCode(Context context, String apkFullPath); static PackageInfo getPackageInfo(Context context); static String getPackageNameFromApk(Context context, String fileName); static long getApkBuildDate(Context context); static boolean isAppInstalledToSDCard(Context context); static void removeApplication(Context context, String pkgName); static void installApplication(Context context, File file); static boolean isPackageExisted(Context context, String targetPackage);  }