ClassCastException at Gallery.setLayoutParams?
<p>I am create a base adapter for a Gallery.</p>

<p>I am using this method to override getView().</p>

<p>But i keep getting this error at the LayoutParam's code.</p>

<pre><code>10-02 01:14:32.543: ERROR/AndroidRuntime(839): FATAL EXCEPTION: main
10-02 01:14:32.543: ERROR/AndroidRuntime(839): java.lang.ClassCastException: android.widget.Gallery$LayoutParams
10-02 01:14:32.543: ERROR/AndroidRuntime(839):     at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:659)
10-02 01:14:32.543: ERROR/AndroidRuntime(839):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:311)
10-02 01:14:32.543: ERROR/AndroidRuntime(839):     at android.view.View.measure(View.java:8313)
10-02 01:14:32.543: ERROR/AndroidRuntime(839):     at android.view.ViewGroup.measureChild(ViewGroup.java:3109)
</code></pre>

<p>Here is my method..</p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) {
    View vi=convertView;
    if(convertView==null)
        vi = inflater.inflate(R.layout.lazyitemt, null);


    ImageView image=(ImageView)vi.findViewById(R.id.image);
    image.setLayoutParams(new Gallery.LayoutParams(250, 250));
    imageLoader.DisplayImage(data[position], activity, image);
    return vi;
}
</code></pre>
