I'm having issues with default android spell checker: it doesn't want to switch to a different language. Instead it uses default system language for spell check.
Spell Checker works with default language, but when I change Locale to a different language it does not give me corrected words, but when I change language of the system Spell Checking works fine.
here is my code:
TextServicesManager tsm = (TextServicesManager) context.getSystemService(
Context.TEXT_SERVICES_MANAGER_SERVICE);
Locale locale = new Locale("fr"); //whatever language
Locale.setDefault(locale);
Configuration config = new Configuration();
config.setLocale(locale);
config.locale = locale;
Resources res = ctx.getResources();
res.updateConfiguration(config, res.getDisplayMetrics());
spellChecherSession = tsm.newSpellCheckerSession(null, locale, this, true);
I read documentation but I can't understand what am I doing wrong.
I've tried modifying locale and config, from multiple answers here, but it didn't work for me.
Please help to solve this problem.
Thanks.