I'm attempting to fade in an image using the same method as fading in text, but I'm getting the error "The method setAnimation(AlphaAnimation) is undefined for the type Image".
I've tried looking around some - I don't think I have to use an animation listener, as was the case in similar problems? I'm only trying to animate one image - here's the section of code:
private void animateNinthDoctor() {
AlphaAnimation fadeInAnimation = new AlphaAnimation(0, 1);
fadeInAnimation.setDuration(1500);
fadeInAnimation.setFillAfter(true);
mImageView1.setAnimation(fadeInAnimation);
}
The error is given on the 'setAnimation' in the last line - mImageView1 is declared using
private Image mImageView1;
Your problem is on the way you are defining the mImageView1
variable. There is not an Image
Class
in Android; you should replace Image
with ImageView
.