My app consist of Fragments with fullscreen WebView. When user click on a link in the WebView then is opened new Fragment with new WebView with the same URL. Before open new Fragment I close soft keyboard just in case. I open new page very quick. All operations perform on the main thread.
By the Crashlytics the problem appers only on the Android 10 (all Pixel-series devices and other devices with 10). On devices before Android 10 all works fine. I can open much Fragments. But on Android 10 devices this case leads to FATAL EXCEPTION (after 2-3 quick attempts to open new page, randomly):
E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
Process: <myapp>, PID: 12487
java.lang.RuntimeException: Probable deadlock detected due to WebView API being called on incorrect thread while the UI thread is blocked.
at Yp.a(PG:13)
at com.android.webview.chromium.WebViewChromium.onCheckIsTextEditor(PG:4)
at android.webkit.WebView.onCheckIsTextEditor(WebView.java:3035)
at android.view.inputmethod.InputMethodManager.checkFocusNoStartInput(InputMethodManager.java:1901)
at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1863)
at android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow(InputMethodManager.java:1506)
at android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow(InputMethodManager.java:1475)
at <myapp>.Utils.hideKeyboard(Utils.java:175)
at <myapp>.openNewPage(Pager.java:210)
...
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
at Yp.a(PG:11)
I tried to use all available versions of the Android System WebView (stable, beta, dev, canary) but nothing to help.
Anybody can help me?
Update:
If I comment code for hiding soft keyboard then all works fine.