I am trying to detect the theme used for an activity but so far I am only able to find that out for the entire application? Is there a way to do this?
Just call the method getTheme() in your activity. For example.
public class MainActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Theme theme = this.getTheme();
}
}
My first thought would be ContextThemeWrapper.getTheme(), since Activity
extends ContextThemeWrapper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With