if (text.indexOf("wi-fi") != -1) {
if (text.indexOf("on") != -1) {
WifiManager wifi = (WifiManager) this.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifi.isWifiEnabled()) {
Toast.makeText(MainActivity.this, "Already WiFi is Enabled", Toast.LENGTH_SHORT).show();
tts.speak("Already WiFi is Enabled", TextToSpeech.QUEUE_ADD, null);
}
else {
wifi.setWifiEnabled(true);
Toast.makeText(MainActivity.this,"Turning on",Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, "Turning on wifi", Toast.LENGTH_SHORT).show();
tts.speak("Turning on wifi", TextToSpeech.QUEUE_ADD, null);
}
}