2013-02-16 2 views
0

이것은 countdowntimer에서 사용하는 코드입니다.CountDownTimer in Animation

mDetector = new GestureDetector(this, new MyGestureDetector()); 

ImageView iv = (ImageView)findViewById(R.id.imageView1); 
iv.setOnTouchListener(new OnTouchListener(){ 
@Override 
public boolean onTouch(View arg0, MotionEvent arg1) { 
    mDetector.onTouchEvent(arg1); 
    final ImageView iv = (ImageView) findViewById(R.id.imageView1); 
    iv.setVisibility(View.GONE); 

    new CountDownTimer(3000, 1000) { 
     public void onTick(long millisUntilFinished) { 
     AnimationDrawable loadingAnimaton; 
     loadingAnimation = (AnimationDrawable) ImageView.getBackground(); 

    }loadingAnimation.start(); 

     }.start(); 
    return true; 
}}); 
} 
} 

내가 토큰에 구문 오류가 이미지로 내 카운트 다운 번호를 설정하려면이 토큰

어떤 다른 방법 후 예상 식별자를 "시작"고 말하는 loadingAnimation.start();에 도착 고마웠다 오류입니다.

답변

0

실제로 2 start() 전화가 있고 둘 다 잘못되었습니다.

 CountDownTimer ct=new CountDownTimer(3000, 1000) { 

     public void onTick(long millisUntilFinished) { 
     AnimationDrawable loadingAnimaton; 
     loadingAnimation = (AnimationDrawable) ImageView.getBackground(); 
     loadingAnimation.start(); 
    } 


    } 
    ct.start(); 
시도