如何禁用所有TextView&EditSxt' s上的拼写检查。
我想这样做,因为当您在文本视图上调用setText()时,它最终会调用拼写检查服务,从而创建异步任务。在我的应用程序中,这会导致一个错误,即调用setText的edittexts卷可以为线程池创建如此多的任务,最终得到RejectedExecutionException。
06-25 09:26:14.442: E/Forms(10981): java.util.concurrent.RejectedExecutionException: Task android.widget.TextView$3@3a7e75dd rejected from java.util.concurrent.ThreadPoolExecutor@257f6244[Running, pool size = 5, active threads = 5, queued tasks = 128, completed tasks = 6382]
06-25 09:26:14.442: E/Forms(10981): at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
06-25 09:26:14.442: E/Forms(10981): at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
06-25 09:26:14.442: E/Forms(10981): at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
06-25 09:26:14.442: E/Forms(10981): at android.os.AsyncTask.execute(AsyncTask.java:608)
06-25 09:26:14.442: E/Forms(10981): at android.widget.TextView.updateTextServicesLocaleAsync(TextView.java:8344)
06-25 09:26:14.442: E/Forms(10981): at android.widget.TextView.getTextServicesLocale(TextView.java:8300)
06-25 09:26:14.442: E/Forms(10981): at android.widget.TextView.getSpellCheckerLocale(TextView.java:8337)
06-25 09:26:14.442: E/Forms(10981): at android.widget.SpellChecker.spellCheck(SpellChecker.java:220)
06-25 09:26:14.442: E/Forms(10981): at android.widget.Editor.updateSpellCheckSpans(Editor.java:541)
我不能在try catch块中包围任何setText(),因为SpellCheckerService也会在其他地方调用,例如。将视图添加到视图组时。