public class SpinnerClosable extends Spinner { public SpinnerClosable(Context context) { super(context); } public SpinnerClosable(Context context, AttributeSet attrs) { super(context, attrs); } public SpinnerClosable(Context mContext, AttributeSet mAttrs, int mDefStyle) { super(mContext, mAttrs, mDefStyle); } public void close() { onDetachedFromWindow(); } }
I use this blog as note to myself on things and tricks I do while developing Android programs. This way, others can have a chance to look at it.
Monday, May 2, 2011
Closable Spinner
I was looking at a way to close a spinner within the code. In the API, I couldn't find any direct method to do so. As a result, I ended up extending the spinner class to have access to the protected method onDetachedFromWindow().
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment