Java Android - Aide Error : There is no applicable contructor to '()' -
i got error
there no applicable contructor "()"
in aide ,
here code, think there no error, got error, how fix it?
public class togglerd extends radiobutton { // implement necessary constructors @override public void toggle() { if(ischecked()) { if(getparent() instanceof radiogroup) { ((radiogroup)getparent()).clearcheck(); } } else { setchecked(true); } } }
if check docs radiobutton see offers 4 constructors, none without arguments. way got extending view
in android creating private
method (call sharedconstructor
or whatever) , call in each of constructors. this:
public class togglerd extends radiobutton { // implement necessary constructors public togglerd(context context) { super(context); } public togglerd(context context, attributeset attrs) { super(context, attrs); } public togglerd(context context, attributeset attrs, int defstyleattr) { super(context, attrs, defstyleattr); } @override public void toggle() { if(ischecked()) { if(getparent() instanceof radiogroup) { ((radiogroup)getparent()).clearcheck(); } } else { setchecked(true); } }
}
since don't override constructor go ahead , call super
.
Comments
Post a Comment