我们的 Android 应用程序随机崩溃(很难重现该问题)并出现以下堆栈跟踪。当设备的方向从 logcat 日志中从纵向更改为横向时,就会出现这种情况。在 Android 4.0.3 版本的设备上也发现了此问题。所以想检查它是否是 4.0.3 的已知问题?从代码中不确定如何调试此问题,因为堆栈跟踪完全是 Android 平台,不涉及应用程序代码。
02-21 17:44:01.761 E/UncaughtException( 3344): java.lang.NullPointerException
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.widget.ScrollingTabContainerView.onItemSelected(ScrollingTabContainerView.java:352)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.AdapterView.fireOnSelected(AdapterView.java:882)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.AdapterView.selectionChanged(AdapterView.java:865)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.AdapterView.checkSelectionChanged(AdapterView.java:1017)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.AdapterView.handleDataChanged(AdapterView.java:999)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:179)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.Spinner.onMeasure(Spinner.java:285)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.HorizontalScrollView.measureChildWithMargins(HorizontalScrollView.java:1159)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.HorizontalScrollView.onMeasure(HorizontalScrollView.java:303)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.widget.ScrollingTabContainerView.onMeasure(ScrollingTabContainerView.java:117)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.widget.ActionBarView.onMeasure(ActionBarView.java:878)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.widget.ActionBarContainer.onMeasure(ActionBarContainer.java:173)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2092)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.View.measure(View.java:12723)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.os.Looper.loop(Looper.java:137)
02-21 17:44:01.761 E/UncaughtException( 3344): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-21 17:44:01.761 E/UncaughtException( 3344): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 17:44:01.761 E/UncaughtException( 3344): at java.lang.reflect.Method.invoke(Method.java:511)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-21 17:44:01.761 E/UncaughtException( 3344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-21 17:44:01.761 E/UncaughtException( 3344): at dalvik.system.NativeStart.main(Native Method)