Error when using Frame/RelativeLayout inside Griddview
<p>I'm creating a custom Gridview, each cell represented by a layout containing</p>

<ul>
<li>1) a custom RatingBar</li>
<li>2) ImageView</li>
</ul>

<p>I inflate them inside the getView() of Adaptor.</p>

<p>It works fine is the said layout is of type Linear. But if I replace it with Frame/relative layout, it crashes with this in Logcat.</p>

<pre><code>04-20 18:19:16.921: E/AndroidRuntime(24111): FATAL EXCEPTION: main
04-20 18:19:16.921: E/AndroidRuntime(24111): java.lang.ClassCastException: android.widget.AbsListView$LayoutParams
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.RelativeLayout$DependencyGraph.findRoots(RelativeLayout.java:1303)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1250)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:281)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:303)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.View.measure(View.java:8313)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.GridView.onMeasure(GridView.java:950)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.View.measure(View.java:8313)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.View.measure(View.java:8313)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.View.measure(View.java:8313)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.ViewRoot.performTraversals(ViewRoot.java:839)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.os.Looper.loop(Looper.java:123)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at android.app.ActivityThread.main(ActivityThread.java:3683)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at java.lang.reflect.Method.invokeNative(Native Method)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at java.lang.reflect.Method.invoke(Method.java:507)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-20 18:19:16.921: E/AndroidRuntime(24111):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>
