我有一个简单的Android应用程序,它只是运行Web应用程序的WebView。
如果我正在使用输入并在最后一个可见输入上按Enter键,键盘就会消失(这很好),但我失去了与WebView中运行的Web应用程序进行交互的所有能力。我仍然可以看到应用程序运行。按后退键而不是输入会导致键盘消失,我没有问题。
任何想法发生了什么以及如何让它停止?
我尝试拦截焦点更改并请求关注Web视图,但似乎Web视图本身永远不会失去焦点。我也尝试过设置一个间隔来重新聚焦web apps document.body,但它没有效果。
代码:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context="com.particlesandbox.Play">
<WebView
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_play);
mWebView = (WebView) findViewById(R.id.view);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setUseWideViewPort(true);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.loadUrl("file:///android_asset/www/index.html");
}
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
logcat的:
07-11 23:07:39.739 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 0
07-11 23:07:39.742 17899-17899/com.particlesandbox W/System: ClassLoader referenced unknown path: /system/framework/QPerformance.jar
07-11 23:07:39.752 17899-17899/com.particlesandbox E/BoostFramework: BoostFramework() : Exception_1 = java.lang.ClassNotFoundException: Didn't find class "com.qualcomm.qti.Performance" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64, /vendor/lib64]]
07-11 23:07:39.752 17899-17899/com.particlesandbox V/BoostFramework: BoostFramework() : mPerf = null
07-11 23:07:39.805 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 1
07-11 23:07:39.908 17899-17899/com.particlesandbox D/InputMethodManager: HSI from window - flag : 0 Pid : 17899
07-11 23:07:40.884 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 0
07-11 23:07:43.086 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 1
07-11 23:07:45.034 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 0
07-11 23:07:45.105 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 1
07-11 23:07:45.240 17899-17899/com.particlesandbox V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@ab7d50f nm : com.particlesandbox ic=null
07-11 23:07:45.240 17899-17899/com.particlesandbox I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
07-11 23:07:45.245 17899-17899/com.particlesandbox D/InputTransport: Input channel constructed: fd=172
07-11 23:07:45.249 17899-17899/com.particlesandbox D/InputTransport: Input channel destroyed: fd=139
07-11 23:07:45.250 17899-17899/com.particlesandbox D/InputMethodManager: ISS - flag : 0Pid : 17899 view : com.particlesandbox
07-11 23:07:45.347 17899-17899/com.particlesandbox D/InputTransport: Input channel constructed: fd=171
07-11 23:07:45.347 17899-17899/com.particlesandbox D/ViewRootImpl@eb7fa5[PopupWindow:bca799c]: setView = android.widget.PopupWindow$PopupDecorView{3c7cf7a V.E...... ......I. 0,0-0,0} touchMode=true
07-11 23:07:45.413 17899-18132/com.particlesandbox D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [60x72]-format:1
07-11 23:07:45.429 17899-19297/com.particlesandbox V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@2d39388 nm : com.particlesandbox ic=org.chromium.content.browser.input.ThreadedInputConnection@e397121
07-11 23:07:45.429 17899-19297/com.particlesandbox I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
07-11 23:07:45.457 17899-19297/com.particlesandbox D/InputTransport: Input channel constructed: fd=175
07-11 23:07:45.486 17899-17899/com.particlesandbox D/ViewRootImpl@eb7fa5[PopupWindow:bca799c]: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
07-11 23:07:45.493 17899-19297/com.particlesandbox D/InputTransport: Input channel destroyed: fd=172
07-11 23:07:45.870 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: MSG_RESIZED: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 750) or=1
07-11 23:07:48.698 17899-17899/com.particlesandbox D/ViewRootImpl@eb7fa5[PopupWindow:bca799c]: dispatchDetachedFromWindow
07-11 23:07:48.738 17899-17899/com.particlesandbox D/InputTransport: Input channel destroyed: fd=171
07-11 23:07:48.772 17899-17899/com.particlesandbox D/InputMethodManager: HSI from window - flag : 0 Pid : 17899
07-11 23:07:48.820 17899-19297/com.particlesandbox V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@9ecd3d2 nm : com.particlesandbox ic=null
07-11 23:07:48.820 17899-19297/com.particlesandbox I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
07-11 23:07:48.825 17899-19297/com.particlesandbox D/InputTransport: Input channel constructed: fd=171
07-11 23:07:48.826 17899-19297/com.particlesandbox D/InputTransport: Input channel destroyed: fd=175
07-11 23:07:48.854 17899-19297/com.particlesandbox W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
07-11 23:07:48.861 17899-19297/com.particlesandbox W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
07-11 23:07:48.951 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: MSG_RESIZED: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
07-11 23:07:50.895 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 0
07-11 23:07:51.090 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 1
07-11 23:07:51.132 17899-17899/com.particlesandbox D/InputMethodManager: HSI from window - flag : 0 Pid : 17899
07-11 23:07:51.482 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 0
07-11 23:07:51.724 17899-17899/com.particlesandbox D/ViewRootImpl@db61f74[Play]: ViewPostImeInputStage processPointer 1
07-11 23:07:51.783 17899-17899/com.particlesandbox D/InputMethodManager: HSI from window - flag : 0 Pid : 17899
答案 0 :(得分:0)
这是Pixi.js中的AccessibilityManager
。
如评论所述,它在所有内容之前创建了div
。
我在renderer
上将其销毁,问题就消失了。
renderer.plugins.accessibility.destroy()