草庐IT

getTheme

全部标签

android - 为什么 getTheme 在应用程序上不能很好地工作

我意识到,对于Context.getTheme(),如果我们使用Application通常效果不佳作为ContextMyApplication.singletonInstance().getTheme().resolveAttribute(R.attr.actionBarDeleteIcon,typedValue,true);//typedValue.resourceIdwillbe0x0,whichisinvalid但是,如果我使用Activity作为上下文,它运作良好MyFragment.this.getActivity().getTheme().resolveAttribute(