美文网首页Android
Android get target app display n

Android get target app display n

作者: JaedenKil | 来源:发表于2018-11-06 17:35 被阅读2次

Each app has a display name in Settings-App.

    String getApplicationDisplayName(Context ctx, String packageName) throws PackageManager.NameNotFoundException {
        PackageManager pm = ctx.getPackageManager();
        ApplicationInfo info = pm.getApplicationInfo(packageName, 0);
        String displayName = info.loadLabel(pm).toString();
        Log.v(TAG, "GetApplicationDisplayName: Application display name is: " + displayName);
        return displayName;
    }

Outputs:

GetApplicationDisplayName: Application display name is: AnTuTu Benchmark

相关文章

网友评论

    本文标题:Android get target app display n

    本文链接:https://www.haomeiwen.com/subject/trouxqtx.html