Android – Change app Theme on onClick [duplicate]

Following blog can solve your problem: http://mrbool.com/how-to-change-the-layout-theme-of-an-android-application/25837 Copying the blog code for quick reference: Assuming that you already defined following three themes in the XML file R.style.FirstTheme, R.style.SecondTheme and R.style.ThirdTheme import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; public class ChangeThemeActivity extends Activity implements OnClickListener { /** Called when the activity is first created. */ … Read more

Apply a theme to an activity in Android?

You can apply a theme to any activity by including android:theme inside <activity> inside manifest file. For example: <activity android:theme=”@android:style/Theme.Dialog”> <activity android:theme=”@style/CustomTheme”> And if you want to set theme programatically then use setTheme() before calling setContentView() and super.onCreate() method inside onCreate() method.

Android: how to change the color of the datepicker divider?

Unfortunately, this is not a trivial task. DatePickers use widgets NumberPicker and CalendarView internally. For instance, the image you have posted is using 3 NumberPickers. And the dividers you are talking about come from NumberPicker’s attribute: selectionDivider. The problem is that this attribute is not public, and neither is numberPickerStyle, through which, this attribute is … Read more

What is so special about Generic.xaml?

Every Control in WPF has a default Style that provides, among other things, the Control’s default ControlTemplate. WPF looks for the default style in a special resource dictionary in the Themes folder in the same assembly as the control. The key for the default style is provided by the Control.DefaultStyleKey dependency property, the default value … Read more

How do I switch my CSS stylesheet using jQuery?

$(‘#grayscale’).click(function (){ $(‘link[href=”https://stackoverflow.com/questions/7846980/style1.css”]’).attr(‘href’,’style2.css’); }); $(‘#original’).click(function (){ $(‘link[href=”style2.css”]’).attr(‘href’,”https://stackoverflow.com/questions/7846980/style1.css”); }); Give this a try but not sure if it will work I have not tested it but gd luck.

How to change current Theme at runtime in Android [duplicate]

I would like to see the method too, where you set once for all your activities. But as far I know you have to set in each activity before showing any views. For reference check this: http://www.anddev.org/applying_a_theme_to_your_application-t817.html Edit (copied from that forum): protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Call setTheme before creation of any(!) … Read more

How to change theme for AlertDialog

In Dialog.java (Android src) a ContextThemeWrapper is used. So you could copy the idea and do something like: AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom)); And then style it like you want: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <style name=”AlertDialogCustom” parent=”@android:style/Theme.Dialog”> <item name=”android:textColor”>#00FF00</item> <item name=”android:typeface”>monospace</item> <item name=”android:textSize”>10sp</item> </style> </resources>