I'm new to the android development, and working my way through android
tutorials available on Android website more specifically relating to
animation. Now I know how to apply tween and frame by frame
animations, but I can't figure out how to combine these two animations
to run simultaneously example of which could be an animating
character(frame by frame) walk across the screen(translate).
I tried putting the both the animation-list for frame by frame
animation and translate animation under the Set tag of my
animation.xml, file and running using the following code.
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.setBackgroundResource(R.anim.animation); //where animation is the
name of my animation xml
AnimationDrawable anim = (AnimationDrawable) iv.getBackground();
anim.start();
But it throws an exception at setBackgroudResource.
A tutorial on how to do that would be highly appreciated.
tutorials available on Android website more specifically relating to
animation. Now I know how to apply tween and frame by frame
animations, but I can't figure out how to combine these two animations
to run simultaneously example of which could be an animating
character(frame by frame) walk across the screen(translate).
I tried putting the both the animation-list for frame by frame
animation and translate animation under the Set tag of my
animation.xml, file and running using the following code.
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.setBackgroundResource(R.anim.animation); //where animation is the
name of my animation xml
AnimationDrawable anim = (AnimationDrawable) iv.getBackground();
anim.start();
But it throws an exception at setBackgroudResource.
A tutorial on how to do that would be highly appreciated.