title: How to use different drawables only during a xml animation with a image view widget (android)
body: <p>How do you make the image view use a specific drawable only for a animation and then revert back to the previous drawable after the animation is finished. My attempt at this is below and it does not work because it never shows the "alt_die_" drawable during the animation. The only drawable thats is shown during and after the animation is the regular "die_" drawable. Note: I am new to android studios, so I am sorry if I did not use proper terms. </p>
  
  <pre><code>        String result;
          AnimationSet down_rotate  = new AnimationSet(false);
          AnimationSet up_rotate    = new AnimationSet(false);  
  
          // Fill the dice widgets with the images to be show during animation 
          for (int index = 0; index &lt; 3; index++) {
  
              String image_name = "alt_die_" + dice_values.get(index) + ".png";
              try {
                  InputStream stream = getAssets().open(image_name);
                  Drawable d = Drawable.createFromStream(stream, null);
                  dice_images.get(index).setImageDrawable(d);
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          // Animate the dice by rolling and bouncing the dice
          down_rotate.addAnimation  (bounce_down());
          down_rotate.addAnimation  (rotate());
          die_image_3.startAnimation(down_rotate);
          die_image_2.startAnimation(down_rotate);
          up_rotate.addAnimation    (bounce_up());
          up_rotate.addAnimation    (rotate());
          die_image_1.startAnimation(up_rotate);
  
          // Fill the dice widgets with the images to be shown after the animation            
          for (int index = 0; index &lt; 3; index++) {   
              String image_name = "die_" + dice_values.get(index) + ".png";
              try {
                  InputStream stream = getAssets().open(image_name);
                  Drawable d = Drawable.createFromStream(stream, null);
                  dice_images.get(index).setImageDrawable(d);
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }            
  </code></pre>