0

I am working on text conversion in android so I want to disable/enable Use WIfi-only option programmatically in TTS.

Here is the code to land at Google TTS option page in settings:

 startActivity(new Intent().setAction("android.speech.tts.engine").setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));

We can disable/enable WIFI using WifiManager :

WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE); 
wifiManager.setWifiEnabled(true);
wifiManager.setWifiEnabled(false);

I have added the screenshot, please suggest me how can I achieve that?

enter image description here

Milan Pansuriya
  • 2,521
  • 1
  • 19
  • 33
learner
  • 3
  • 3
  • I know this might be annoying because I'm not providing an answer, but... this setting is designed (by Google) to be set by the user, so why do you believe it's necessary for you to control it? – Nerdy Bunz Dec 11 '18 at 10:59

1 Answers1

-1

You can not change the settings designed by google but can make use to download the language TTS support for particular device.

Here is what you can do to achieve this:

startActivity(new Intent().setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA)); 

This will automatically download the language you selected to speak .

chand mohd
  • 2,363
  • 1
  • 14
  • 27