I understand that for Context.getTheme()it usually does not work if we use ApplicationbothContext
MyApplication.singletonInstance().getTheme().resolveAttribute(R.attr.actionBarDeleteIcon, typedValue, true);
However, if I use Activityas context, it works well
MyFragment.this.getActivity().getTheme().resolveAttribute(R.attr.actionBarDeleteIcon, typedValue, true);
// typedValue.resourceId is valid
I was wondering why we cannot resolve the attribute through Application?
In the manifest we provide specific information about the topic at the level Application. So, I thought getting a topic from an object made Applicationsense.
<application
android:theme="..."
source
share