Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Android TTS: How to set the language? (Method not found: 'Java.Util.Locale..ctor')

$
0
0

I'm getting an exception "Method not found: 'Java.Util.Locale..ctor'".

This is my code:

var c = Forms.Context; 
speaker = new TextToSpeech (c, this);
var languageIso = "en-GB";
var locale = new Locale(languageIso);// languageIso is locale string
speaker.SetLanguage (locale);

This code is called via a dependency service.

DependencyService.Get<ITextToSpeech> ().SetBritishVoice ();

What am I doing wrong?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>