写三个构造函数就OK了:
public class ExtendedClass extends Button {
public ExtendedClass(Context context) {super( context, attrs );}public ExtendedClass(Context context, AttributeSet attrs) {super( context, attrs );}public ExtendedClass(Context context, AttributeSet attrs, int defStyle) {super( context, attrs, defStyle );}}