views:

21

answers:

0

Is it possible to play a frame animation on a Toast View?

Lines 3-5 in the code below are what usually works for me if I want to play a frame animation on a View. Unfortunately when I try to apply that view to a toast object, it is not animating when the toast is shown. Does anyone know if it is possible to have a frame animation play on a toast object? If so, how? Thanks

LayoutInflater inflaterSpin = getLayoutInflater();
View layout = inflaterSpin.inflate(R.layout.toast_layout, (ViewGroup)   findViewById(R.id.toast_layout_root));

layout.setBackgroundResource(R.anim.anim_toast);
AnimationDrawable toastAnim = (AnimationDrawable) layout.getBackground();
toastAnim.start();

myToast = new Toast(getApplicationContext());             
myToast.setView(layoutSpin);
myToast.show();