指定應用ID以獲取對應的應用名稱

/**
* 獲取應用程序名稱
*/
public static String getAppName(Context context,String packageId)
{
    try
    {
        PackageManager packageManager = context.getPackageManager();
        PackageInfo packageInfo = packageManager.getPackageInfo(packageId, 0);
        return packageInfo.applicationInfo.loadLabel(packageManager).toString();
    } catch (NameNotFoundException e)
    {
        e.printStackTrace();
    }
    return null;
}

所屬標簽

無標簽

25选5玩法中奖