views:

157

answers:

1

I tried to construct SlidingDrawer widget programmatically, but had no luck. The JavaDoc says the constructor needs "AttributeSet attrs" parameter, which is "a specified set of attributes defined in XML". I provided my own implementation of AttributeSet interface, with all the attributes mentioned in JavaDoc, but got a weird ClassCastException - it seems that it assumes the attrs parameter is of type TypedArray, which seems to be impossible to use as base class (constructor hidden). Is there a way to construct SlidingDrawer programmatically and what is the correct contract to use it ? It is no way clear from the documentation.

+1  A: 

try this out
http://tech-droid.blogspot.com/2009/08/android-sliding-drawer-example.html
http://github.com/commonsguy/cw-android/tree/master/Fancy/DrawerDemo/

zapping
Thanks for reply, but this is not what I look for. I would like to construct SlidingDrawer programmatically and I am stuck as I can't figure out what to put in to satisfy the constructor.
Pavel Lahoda