Last active
January 4, 2016 10:39
-
-
Save GabrielCastro/8610419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<issue | |
id="Instantiatable" | |
severity="Fatal" | |
message="This class should provide a default constructor (a public constructor with no arguments) (my.package.name.MyView)" | |
category="Correctness" | |
priority="6" | |
summary="Ensures that classes registered in the manifest file are instantiatable" | |
explanation="Activities, services, broadcast receivers etc. registered in the manifest file must be "instantiatable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class." | |
errorLine1=" public MyView(Context context, AttributeSet attrs, int defStyle) { | |
" | |
errorLine2=" ~~~~~~~~~~"> | |
<location | |
file="C:\[...]\NumberView.java" | |
line="40" | |
column="12"/> | |
</issue> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
public class MyView extends View { | |
... | |
public MyView(Context context) { | |
super(context); | |
init(context); | |
} | |
public MyView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
init(context); | |
} | |
public MyView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
init(context); | |
} | |
// makes lint happy, but I shouldn't need this | |
public MyView() { | |
super(null); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment