I am developing an Android application that should work on both types of devices: phone, tv and tv box. To do this, I created resources with a TV modifier (for example, textSizes in dimens that will change automatically depending on the uimode), but the problem is that TV boxes use mobile insead of TV. How to change the uimode on app start in order to use dimens with tv modifer?
I've already tried this, but it doesn't work.
config.uiMode = Configuration.UI_MODE_TYPE_TELEVISION
resources.updateConfiguration(config, resources.displayMetrics)