Before honeycomb, dialogs used their own theme, it is now inherited from the parent
Use this function to generate the AlertDialog context so the theming remains constant.
public Context getThemedContext() {
Context themedContext;
if (android.os.Build.VERSION.SDK_INT >=
Build.VERSION_CODES.HONEYCOMB) {
themedContext = this;
} else {
themedContext = new ContextThemeWrapper(this,
android.R.style.Theme_Dialog);
}
return themedContext;
}
Written by James O'Brien
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Android
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#