Code example for AnimationDrawable

Methods: isRunning, setOneShot, start, stop

0
			} else { 
				cards[num].setImageResource(getResources().getIdentifier("animqueen", "drawable", getPackageName()));
			} 
		} 
		AnimationDrawable anim = (AnimationDrawable)cards[num].getDrawable();
		anim.setOneShot(true); // 1���ŏI����
		if(anim.isRunning()) anim.stop(); // �A�j���[�V�������Ȃ��~�߂�
		anim.start();
	} 
	 
	public void game(int i) {
		if (card_sound_which[i-1] == 0) {
			playSound(card_sound[i-1]+1);
		} 
		if (card_sound[i-1] == card_sound[clicked]) {//�O�ɃN���b�N���ꂽ���̂Ɠ����ԍ��̃J�[�h��������
			if (TURN == -1) {//king's turn
				cards[i-1].setOnClickListener(null);
				touchAnimation(i-1, "king");
				cards[clicked].setOnClickListener(null);
				touchAnimation(clicked, "king");
				kingpoint ++;