Я создаю приложение, которое расширяет PreferenceActivity, и я хочу добавить значок для каждого параметра.
Я прочитал аналогичный вопрос, и это ответ с большей репутацией:
Сообщество CommonsWare:
В приложении "Настройки" используется специальный пользовательский подкласс PreferenceScreen, чтобы иметь значок - IconPreferenceScreen. Это 51 строка кода, включая комментарии, хотя для этого также требуются некоторые пользовательские атрибуты. Самый простой вариант - клонировать все это в ваш проект, даже если вам это не нравится.
Но я не могу заставить его работать. На данный момент я клонировал класс IconPreferenceScreen в свой проект. И я не знаю, что мне делать после этого. Я пытаюсь создать новый IconPreferenceScreen, я не могу заставить его работать.
IconPreferenceScreen test = new IconPreferenceScreen();
test.setIcon(icon);