0

I'm trying to access the subtitle settings, so I can change them.

But I'm not managing to find a way to access these settings.

Some advice?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Paul
  • 3,644
  • 9
  • 47
  • 113

1 Answers1

1

You can use an Intent object like this to open Caption Settings:

NOTE: Minimum API level is 19

Intent intent = new Intent(Settings.ACTION_CAPTIONING_SETTINGS);
startActivity(intent);

For example, if you have a button to open Caption Settings on click.

Button button = (Button) findViewById(R.id.btn);

    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Settings.ACTION_CAPTIONING_SETTINGS);
            startActivity(intent);
        }
    });

You can return by pressing back button on device.

itsmysterybox
  • 2,748
  • 3
  • 21
  • 26
  • Thx, it works. I do not understand just why when I change settings, such as text color. I go back, but the change is not seen. I have to close app, and reappropriate it. – Paul Sep 22 '18 at 15:30
  • You will need to handle configuration changes. Following links may help you to understand it: --> https://developer.android.com/guide/topics/resources/runtime-changes --> https://stackoverflow.com/questions/3832959/android-reflect-ui-language-change-on-the-on-the-fly-without-reload-restarting?noredirect=1&lq=1 --> https://stackoverflow.com/questions/12908289/how-to-change-language-of-app-when-user-selects-language --> https://stackoverflow.com/questions/12908289/how-to-change-language-of-app-when-user-selects-language – itsmysterybox Sep 22 '18 at 15:44