I get a ClassCastException when trying to animate a GifImage in BlackBerry. I tried many ways, but all cause that exception. I referred to the BlackBerry knowledgecenter article "Display An Animated GIF" and I tried the following code in my mainscreen. I also tried using @swati's code from the "Animated GIF" blog post. What is my mistake?
GIFEncodedImage bitmapImage=(GIFEncodedImage)GIFEncodedImage.getEncodedImageResource("CuteCapLa4.gif"); //**Getting Exception at this line**
AnimatedGIFField image_field=new AnimatedGIFField(bitmapImage);
add(image_field);