モバイル設定でフォントサイズを変更すると_(settings->Display->Font size)
_コルドバアプリケーションがインデックスページ(ルートページを意味する)にリダイレクトされ、
アプリケーションが破壊されたWebView
を呼び出そうとしました
私のログ:
Application attempted to call on a destroyed WebView Java.lang.Throwable at org.chromium.Android_webview.AwContents.isDestroyed(AwContents.Java:349) at org.chromium.Android_webview.AwContents.isDestroyedOrNoOperation(AwContents.jav :321) org.chromium.Android_webview.AwContents.getTitle(AwContents.Java:576) at org.chromium.Android_webview.AwWebContentsDelegateAdapter.loadingStateChanged(AwWebContentsDelegateAdapter.Java:132) at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.Java:9)at Android.os.Handler.dispatchMessage(Handler.Java:102) at Android.os.Looper.loop(Looper.Java:148) at Android.app.ActivityThread.main(ActivityThread.Java:5451) at Java.lang.reflect.Method.invoke(Native Method) at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:726) at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:616)
別のログ:
E/ActivityThread: Activity MainActivity has leaked IntentReceiver org.Apache.cordova.engine.SystemWebViewEngine$2@5c35c47 that was originally registered here. Are you missing a call to unregisterReceiver()? Android.app.IntentReceiverLeaked: Activity .MainActivity has leaked IntentReceiver org.Apache.cordova.engine.SystemWebViewEngine$2@5c35c47 that was originally registered here. Are you missing a call to unregisterReceiver()? at Android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.Java:921) at Android.app.LoadedApk.getReceiverDispatcher(LoadedApk.Java:722) at Android.app.ContextImpl.registerReceiverInternal(ContextImpl.Java:1193) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1173) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1167) at Android.content.ContextWrapper.registerReceiver(ContextWrapper.Java:561) at org.Apache.cordova.engine.SystemWebViewEngine.initWebViewSettings(SystemWebViewEngine.Java:242) at org.Apache.cordova.engine.SystemWebViewEngine.init(SystemWebViewEngine.Java:108) at org.Apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.Java:110) at org.Apache.cordova.CordovaActivity.init(CordovaActivity.Java:149) at org.Apache.cordova.CordovaActivity.loadUrl(CordovaActivity.Java:224) at .MainActivity.adjustFontScale(MainActivity.Java:68) at .MainActivity.onCreate(MainActivity.Java:47) at Android.app.Activity.performCreate(Activity.Java:6323) at Android.app.Instrumentation.callActivityOnCreate(Instrumentation.Java:1108) at Android.app.ActivityThread.performLaunchActivity(ActivityThread.Java:2387) at Android.app.ActivityThread.handleLaunchActivity(ActivityThread.Java:2494) at Android.app.ActivityThread.access$900(ActivityThread.Java:153) at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:1347) at Android.os.Handler.dispatchMessage(Handler.Java:102) at Android.os.Looper.loop(Looper.Java:148) at Android.app.ActivityThread.main(ActivityThread.Java:5451) at Java.lang.reflect.Method.invoke(Native Method) at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:726) at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:616) 04-27 15:44:30.643 3522-3522/ E/ActivityThread: Activity .MainActivity has leaked IntentReceiver org.Apache.cordova.CoreAndroid$5@ea2742b that was originally registered here. Are you missing a call to unregisterReceiver()? Android.app.IntentReceiverLeaked: Activity .MainActivity has leaked IntentReceiver org.Apache.cordova.CoreAndroid$5@ea2742b that was originally registered here. Are you missing a call to unregisterReceiver()? at Android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.Java:921) at Android.app.LoadedApk.getReceiverDispatcher(LoadedApk.Java:722) at Android.app.ContextImpl.registerReceiverInternal(ContextImpl.Java:1193) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1173) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1167) at Android.content.ContextWrapper.registerReceiver(ContextWrapper.Java:561) at org.Apache.cordova.CoreAndroid.initTelephonyReceiver(CoreAndroid.Java:314) at org.Apache.cordova.CoreAndroid.pluginInitialize(CoreAndroid.Java:63) at org.Apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.Java:58) at org.Apache.cordova.PluginManager.getPlugin(PluginManager.Java:171) at org.Apache.cordova.PluginManager.exec(PluginManager.Java:122) at org.Apache.cordova.CordovaBridge.jsExec(CordovaBridge.Java:57) at org.Apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.Java:41) at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.Java:9) at Android.os.Handler.dispatchMessage(Handler.Java:102) at Android.os.Looper.loop(Looper.Java:148) at Android.os.HandlerThread.run(HandlerThread.Java:61) 04-27 15:44:30.644 3522-3522/ E/ActivityThread: Activity .MainActivity has leaked IntentReceiver org.Apache.cordova.networkinformation.NetworkManager$1@ee337ef that was originally registered here. Are you missing a call to unregisterReceiver()? Android.app.IntentReceiverLeaked: Activity .MainActivity has leaked IntentReceiver org.Apache.cordova.networkinformation.NetworkManager$1@ee337ef that was originally registered here. Are you missing a call to unregisterReceiver()? at Android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.Java:921) at Android.app.LoadedApk.getReceiverDispatcher(LoadedApk.Java:722) at Android.app.ContextImpl.registerReceiverInternal(ContextImpl.Java:1193) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1173) at Android.app.ContextImpl.registerReceiver(ContextImpl.Java:1167) at Android.content.ContextWrapper.registerReceiver(ContextWrapper.Java:561) at org.Apache.cordova.networkinformation.NetworkManager.initialize(NetworkManager.Java:114) at org.Apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.Java:57) at org.Apache.cordova.PluginManager.getPlugin(PluginManager.Java:171) at org.Apache.cordova.PluginManager.exec(PluginManager.Java:122) at org.Apache.cordova.CordovaBridge.jsExec(CordovaBridge.Java:57) at org.Apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.Java:41) at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.Java:9) at Android.os.Handler.dispatchMessage(Handler.Java:102) at Android.os.Looper.loop(Looper.Java:148) at Android.os.HandlerThread.run(HandlerThread.Java:61)
誰かがこれを手伝ってくれますか?.
同様のエラーを受け取りましたが、adView(これはWebViewです)の場合です。これは、「アプリケーションが破棄されたWebViewを呼び出そうとした」というエラーを修正するのに役立ちました。 adViewをWebViewのインスタンスに置き換えます。動作するはずです。
_ @Override
public void onDestroyView() {
if(adView != null) {
//rootView is the inflated view of the fragment/activity
((ViewGroup) rootView.getParent()).removeAllViews();
adView.removeAllViews();
super.onDestroyView();
}
}
@Override
public void onDestroy() {
if(adView != null) adView.destroy();
super.onDestroy();
}
_
StackOverflowからの他の回答は、上記の3つのvoid onDestroy()の呼び出しを行うと述べていますが、同じ問題が引き続き発生しました。上記の作業ソリューションでは、adView.destroy()
呼び出しをremoveAllViews()
呼び出しから分離する必要があります。
また、適切な場所でadView.resume()
およびadView.pause()
を呼び出すことをお勧めします。