When trying to add a header to a listview i keep on getting a
java.lang.ClassCastException: android.widget.LinearLayout
$LayoutParams. I thought it might be a problem with the widget i was
adding to the header so i made the simple test case below which add
just a colored linearlayout as the header and the problem still
occurs. The rendering of the list with the adapter is working fine, i
just cant add a header to it. Any help would be appreciated

thanks

_list = new ListView(this);

LinearLayout ll = new LinearLayout(this);
ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 100));
ll.setBackgroundColor(Color.RED);
list.addHeaderView(ll);

_list.setAdapter(_adapter);

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to