我已将Android SDK 23升级到26个Api库, 应用程序正在使用Listview,Fragment,FrameLayout,相对和线性布局。
主屏幕已升级
-> CoordinatorLayout
-> AppBarLayout
-> CollapsingToolbarLayout
->工具栏
-> SlidingTabLayout
其余内容对于内部屏幕都是相同的。
问题是:应用程序启动并打开主屏幕,经过一段时间/一段时间后,应用程序出现以下(以下)错误并崩溃了。找不到根本原因。搜索了很多并找到了,也许ListView适配器有问题。请给我一个主意。
08-22 16:46:19.057 5234-6825/? E/Watchdog: !@Sync 12989 [2018-08-22 16:46:19.057]
08-22 16:46:19.324 3237-3237/? E/Sensors: inject_scontext_data: New ssp_data_injection_fd(32)
08-22 16:46:20.987 6696-6696/? E/SignalClusterView: setSlotFocusVisible : subId 2
setSlotFocusVisible : subId 2
08-22 16:46:23.282 21569-21569/com.XXXX E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.XXXX, PID: 21569
java.lang.StackOverflowError: stack size 8MB
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7531)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
08-22 16:46:23.285 21569-21569/com.nimbuzz E/AndroidRuntime: at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
at android.view.ViewGroup.resetResolvedLayoutDirection(ViewGroup.java:7533)
答案 0 :(得分:0)
将inflate(R.layout.layout2,container)
更改为inflate(R.layout.layout2,null)
或inflate(R.layout.layout2,container,false)
。希望它能对您有所帮助。