Solved the problem. My linear layout needed this line to behave well within gallery widget myLayout.setLayoutParams(new Gallery.LayoutParams(140, 140));
Nothing beats scientific trial and error especially with super scarce SDK documentation. A 1 line explanation in Gallery docs would have saved me hours. On Jan 13, 10:54 am, loty <[email protected]> wrote: > I'm getting a class cast exception when I try to use LinearLayout in > Gallery. Is it a bug? Not yet supported feature? Has anyone got it > working? Looks like it tries to get measurements from LinearLayout and > then barfs out in Gallery somewhere. > > 01-13 10:47:52.294: ERROR/AndroidRuntime(428): Uncaught handler: > thread main exiting due to uncaught exception > 01-13 10:47:52.356: ERROR/AndroidRuntime(428): > java.lang.ClassCastException: android.widget.Gallery$LayoutParams > 01-13 10:47:52.356: ERROR/AndroidRuntime(428): at > android.widget.LinearLayout.measureVertical(LinearLayout.java:323) > 01-13 10:47:52.356: ERROR/AndroidRuntime(428): at > android.widget.LinearLayout.onMeasure(LinearLayout.java:275) > 01-13 10:47:52.356: ERROR/AndroidRuntime(428): at > android.view.View.measure(View.java:6621) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

