newSpellCheckerSession always returns null

前端 未结 2 1764
醉酒成梦
醉酒成梦 2021-01-18 00:44

I\'m trying to hook into the built in Android spell checking service on my Note tablet. When I call

    final TextServicesManager tsm = (TextServicesManage         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 01:07

    You may want to set the local explicitly, and set last parameter to false, as it checks the active locales on the device.

    final TextServicesManager tsm = (TextServicesManager) getSystemService(
            Context.TEXT_SERVICES_MANAGER_SERVICE);
    spellCheck = tsm.newSpellCheckerSession(null, Local.ENGLISH, this, false); 
    

提交回复
热议问题