0

Can i run an animationDrawable more then once while setOneShot() is set to true?

Or if i do set setOneShot to false how can i stop it? frameAnimation.stop() after a loop doesn't work and the loop doesn't work with setOneShot(true)

I asked this in my previous Q, but the answer pointed to a post with several different answers making things more confusing.

Basicly i'm trying to spin a coin more then once.

With setOneShot(true) i can only ever make it run once and with setOneShot(false) i can't stop it. Any help or point to right direction would be great!

Here is a little code:

    public void spinCoin(){

        final ImageView coinAmina = (ImageView) findViewById(R.id.imageView1);
        coinAmina.setBackgroundResource(R.anim.coin_spin_heads); 
        coinAmina.post(new Runnable() {

            @Override
            public void run() {
                frameAnimation = (AnimationDrawable) coinAmina.getBackground();
                frameAnimation.start();
            }
        }); 

        //end of coin spin
        }

with setOneShot(true) in xml

link to other Q.

how do i run AnimationDrawable 3 times

Community
  • 1
  • 1

0 Answers0