I am a complete noob and I am trying to decrease the padding of an image over time with my code. I have this so far:
public void growPotato() {
long base = System.currentTimeMillis();
long WorkingNum = 0;
while(growing && WorkingNum > 5 ) {
WorkingNum = 150 - ((System.currentTimeMillis() - base)/100);
ImageView PotatoPicture = (ImageView) findViewById(R.id.imageView1);
PotatoPicture.SetPadding(WorkingNum);
}
I get an error on the line after ‘WorkingNum = 150 -‘ saying I am missing a ‘;’ for ‘LocalVariableDeclarationAssignment’. But my main problem is that I get the error: “The method SetPadding(long) is undefined for the type ImageView”… How can I work around or fix this?
Instead of:
you should call:
Java is case sensitive, so setPadding and SetPadding aren’t the same methods. Read API for more details: ImageView.setPadding(int, int, int, int).
In most Java naming conventions, local variables should start with lower case letter (or an underscore).