PanelSwitchHelper
PanelSwitchHelper copied to clipboard
貌似是Dialog中放了Fragment就会崩溃
2022-04-23 00:00:32.159 25039-25476/com.maitang.hila E/libc: Access denied finding property "net.dns1" 2022-04-23 00:00:32.159 25039-25476/com.maitang.hila E/libc: Access denied finding property "net.dns2" 2022-04-23 00:00:32.159 25039-25476/com.maitang.hila E/libc: Access denied finding property "net.dns3" 2022-04-23 00:00:32.159 25039-25476/com.maitang.hila E/libc: Access denied finding property "net.dns4" 2022-04-23 00:00:32.230 25039-25039/com.maitang.hila E/om.maitang.hil: Invalid ID 0x00000004. 2022-04-23 00:00:32.232 25039-25039/com.maitang.hila E/AndroidRuntime: FATAL EXCEPTION: main Process: com.maitang.hila, PID: 25039 android.content.res.Resources$NotFoundException: Unable to find resource ID #0x4 at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:279) at android.content.res.Resources.getResourceEntryName(Resources.java:2028) at com.effective.android.panel.utils.DisplayUtil.isNavBarVisible(DisplayUtil.kt:187) at com.effective.android.panel.utils.DisplayUtil.isNavigationBarShow(DisplayUtil.kt:164) at com.effective.android.panel.device.DeviceRuntime.getDeviceInfoByOrientation(DeviceRuntime.kt:34) at com.effective.android.panel.view.PanelSwitchLayout$bindWindow$$inlined$let$lambda$1.onGlobalLayout(PanelSwitchLayout.kt:294) at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2431) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1535) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7405) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1044) at android.view.Choreographer.doCallbacks(Choreographer.java:839) at android.view.Choreographer.doFrame(Choreographer.java:774) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1030) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6864) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 2022-04-23 00:00:32.243 25039-25039/com.maitang.hila E/CrashHandler: In thread: Thread[main,5,main] UncaughtException detected: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x4 at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:279) at android.content.res.Resources.getResourceEntryName(Resources.java:2028) at com.effective.android.panel.utils.DisplayUtil.isNavBarVisible(DisplayUtil.kt:187) at com.effective.android.panel.utils.DisplayUtil.isNavigationBarShow(DisplayUtil.kt:164) at com.effective.android.panel.device.DeviceRuntime.getDeviceInfoByOrientation(DeviceRuntime.kt:34) at com.effective.android.panel.view.PanelSwitchLayout$bindWindow$$inlined$let$lambda$1.onGlobalLayout(PanelSwitchLayout.kt:294) at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2431) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1535) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7405) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1044) at android.view.Choreographer.doCallbacks(Choreographer.java:839) at android.view.Choreographer.doFrame(Choreographer.java:774) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1030) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6864) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 2022-04-23 00:00:32.244 25039-25039/com.maitang.hila E/CustomActivityOnCrash: App has crashed, executing CustomActivityOnCrash's UncaughtExceptionHandler android.content.res.Resources$NotFoundException: Unable to find resource ID #0x4 at android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:279) at android.content.res.Resources.getResourceEntryName(Resources.java:2028) at com.effective.android.panel.utils.DisplayUtil.isNavBarVisible(DisplayUtil.kt:187) at com.effective.android.panel.utils.DisplayUtil.isNavigationBarShow(DisplayUtil.kt:164) at com.effective.android.panel.device.DeviceRuntime.getDeviceInfoByOrientation(DeviceRuntime.kt:34) at com.effective.android.panel.view.PanelSwitchLayout$bindWindow$$inlined$let$lambda$1.onGlobalLayout(PanelSwitchLayout.kt:294) at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2431) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1535) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7405) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1044) at android.view.Choreographer.doCallbacks(Choreographer.java:839) at android.view.Choreographer.doFrame(Choreographer.java:774) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1030) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6864) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
这样添加的没有ID,你取ID那块可能要checkNull一下~ DisplayUtil.kt:187
ViewGroup decorView = (ViewGroup) XPopupUtils.context2Activity(this).getWindow().getDecorView(); if(getParent()!=null) ((ViewGroup)getParent()).removeView(this); decorView.addView(this);
遇到同样崩溃问题的可以先给设置个ID 过一下崩溃。
ViewGroup decorView = (ViewGroup) XPopupUtils.context2Activity(this).getWindow().getDecorView(); if(getParent()!=null) ((ViewGroup)getParent()).removeView(this); this.setId(-1);////兼容软键盘lib奔溃问题 decorView.addView(this);
v1.5.0 已经修复