在onCreate方法加入这些代码,布局xml定义了Id为image的ImageButton。
显示效果就只有icon_avi.png这张图片,第二种图片icon_file_document.png没播放到,为什么?
ImageButton imageButton =
(ImageButton)findViewById(R.id.image);
AnimationDrawable imageButtonAnimation = new
AnimationDrawable();
imageButtonAnimation.addFrame(getResources().getDrawable(R.drawable.icon_avi),
300);
imageButtonAnimation.addFrame(getResources().getDrawable(R.drawable.icon_file_document),
300);
imageButton.setImageDrawable(imageButtonAnimation);
imageButtonAnimation.setVisible(true, false);
imageButtonAnimation.start();
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en