android 4.0.3 ScrollingTabContainerView NullPointerException <p>Our Android Application randomly crashes (very hard to repro the issue) with the following stack trace . This is seen when the orientation of the device is changed from portrait to landscape from the logcat logs. Also this issue has been seen on devices with Android 4.0.3 version. So wanted to check if it is a known issue with 4.0.3? Not sure from the code how to debug this issue as the stack trace is entirely of Android platform with no involvement of App code. </p> <pre><code>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) </code></pre>