Пример #1
0
        public static int GetIconId(string name, Context context)
        {
            if (icons.ContainsKey(name) == true)
            {
                return icons[name];
            }

            int id = context.GetResources().GetIdentifier(name, "drawable", context.GetPackageName());
            if (id == 0)
            {
                return 0;
            }

            icons.Add(name, id);

            return id;
        }