我的应用程序有一个通用的主要活动
主活动从arrays.xml读取其配置,如下所示
@string/Title_1
@drawable/google
http://www.google.com
@style/my_theme
通过这种方式添加一个新图标,我只需在这里添加新行.
所以在“主题”中我有主题的名字.我如何加载和应用名称引用的主题?
对于我用过的图标
TypedArray mItemsIcons = resources.obtainTypedArray(R.array.home_buttons_icon);
TypedArray mThemes = resources.obtainTypedArray(R.array.themes);
.
.
.
mItemsIcons.getDrawable(position);
.
.
.
但我不知道如何获得主题.
我测试过了
int theme = mThemes.getResourceId(position);
setTheme(theme);
但它不起作用.