我在WebView
内显示DialogFragment
显示登录页面,在用户介绍用户名和密码后,系统会提示他保存密码,但如果用户在那一刻旋转手机,WebView
将崩溃,提示将对用户隐藏,从而无法重新输入/重写数据,在这些功能中禁用WebView
,并且在{{1}的特定情况下幸存下来的配置更改,用户将无法提交数据,即使我再次更改配置,另一个问题是内部操作系统不再恢复,直到我重建所有内容,例如,我离开DialogFragment
当我重新创建它时,键盘在配置再次更改之前不会显示。
崩溃日志如下:
WebView
EDIT
更正了创建后焦点的12-24 08:36:21.694: E/WindowManager(21235): Activity com.example.twitterlibraryservice.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@45aef418 that was originally added here
12-24 08:36:21.694: E/WindowManager(21235): android.view.WindowLeaked: Activity com.example.twitterlibraryservice.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@45aef418 that was originally added here
12-24 08:36:21.694: E/WindowManager(21235): at android.view.ViewRoot.<init>(ViewRoot.java:255)
12-24 08:36:21.694: E/WindowManager(21235): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
12-24 08:36:21.694: E/WindowManager(21235): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
12-24 08:36:21.694: E/WindowManager(21235): at android.view.Window$LocalWindowManager.addView(Window.java:424)
12-24 08:36:21.694: E/WindowManager(21235): at android.app.Dialog.show(Dialog.java:241)
12-24 08:36:21.694: E/WindowManager(21235): at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
12-24 08:36:21.694: E/WindowManager(21235): at android.webkit.WebView.onSavePassword(WebView.java:1065)
12-24 08:36:21.694: E/WindowManager(21235): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:431)
12-24 08:36:21.694: E/WindowManager(21235): at android.os.Handler.dispatchMessage(Handler.java:99)
12-24 08:36:21.694: E/WindowManager(21235): at android.os.Looper.loop(Looper.java:143)
12-24 08:36:21.694: E/WindowManager(21235): at android.app.ActivityThread.main(ActivityThread.java:4717)
12-24 08:36:21.694: E/WindowManager(21235): at java.lang.reflect.Method.invokeNative(Native Method)
12-24 08:36:21.694: E/WindowManager(21235): at java.lang.reflect.Method.invoke(Method.java:521)
12-24 08:36:21.694: E/WindowManager(21235): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-24 08:36:21.694: E/WindowManager(21235): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-24 08:36:21.694: E/WindowManager(21235): at dalvik.system.NativeStart.main(Native Method)
键盘问题。
WebView
答案 0 :(得分:0)
我猜你的Activiy不会处理方向变化。因此,Android操作系统会杀死您的活动并使用新方向创建新活动。
您可以尝试在活动的dimiss
中调用DialogFragment的onPause
方法。
这可能会修复你的泄漏,但行为可能不是你所期望的。