DEV Community

leminhduc1202
leminhduc1202

Posted on

Answer: Android - How to get application name? (Not package name)

Java

public static String getApplicationName(Context context) {
    return context.getApplicationInfo().loadLabel(context.getPackageManager()).toString();
}

Kotlin (as extension)

fun Context.getAppName(): String = applicationInfo.loadLabel(packageManager).toString()

Top comments (0)