我尝试用这种方式制作动画:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startAnimation();
}
void startAnimation(){
AnimationDrawable animDrawable = new AnimationDrawable();
animDrawable.addFrame(getResources().getDrawable(R.drawable.wait_connextion_0),100);
animDrawable.addFrame(getResources().getDrawable(R.drawable.wait_connextion_1), 100);
animDrawable.addFrame(getResources().getDrawable(R.drawable.wait_connextion_2), 100);
animDrawable.addFrame(getResources().getDrawable(R.drawable.wait_connextion_3), 100);
animDrawable.setOneShot(false);
ImageView waitIV = (ImageView) findViewById(R.id.waitIV);
waitIV.setBackgroundDrawable(animDrawable);
animDrawable.start();
}
但它不起作用,你能告诉我这是什么问题:-(