So what I need to do is toggle window and/or transition animations on and off in code, to have the same effect of going Settings > Display > Animations > Disable all animations.
The way I am familiar with changing device settings is by using a ContentResolver within the Settings.System.putInt() method as follows:
ContentResolver cr = getContentResolver(); Settings.System.putInt(cr, Settings.System.WINDOW_ANIMATION_SCALE, 0); As described in the documentation 'Setting to 0 will disable all .... animations' for both settings. When reading the setting before and after using the putInt() method, using this:
Settings.System.getString(cr, Settings.System.WINDOW_ANIMATION_SCALE); I can see that the setting is being changed. However when then doing something to begin a window or transition animation it is obvious to see that the setting hasn't made any difference and the transition still occurs.
I would also like to say that when I change the setting from within the Settings screen, I can see that the setting has been changed when I rerun my application. So it seems this is the correct setting and that my application isn't changing it correctly.
Is there something else I'm missing?
Thanks in advance.