tags:

views:

37

answers:

1

Im reading a book "Pragmatics: Hello Android" and copy the code word for word and syntax is all correct because i get no errors but it does not do what i tell it to do on the onAnimationEnd.. it suppose to take me to my next activity but since that was not working i changed it to something simple like txtView.setText("ggag") just to see if it was even executing... and i noticed the way the book goes about it is slightly different..

    Animation fadein = AnimationUtils.loadAnimation(this, R.anim.fade_in);
    fadein.setAnimationListener(new AnimationListener() { /*im thinking the problem is
     that it does all the work from within the setAnimationLIstener instead of like i
     have seen around where the methods onAnimationEnd , onAnimationRepeat are all
     done seprately outside of the  
      setAnimationListener(new AnimationListener() {..all work is done here??... } */
     @Override
     public void onAnimationEnd(Animation animation) {
      //startActivity(new Intent(splahActivity.this,menuActivity.class));
      //the above line of code was not working so i added the line below 
      //neither executes

                    TextView topLogo = (TextView)findViewById(R.id.lblTop);
      topLogo.setText("dfsgsdfg");

     }

    @Override
    public void onAnimationRepeat(Animation animation) {
      // TODO Auto-generated method stub

    }

    @Override
    public void onAnimationStart(Animation animation) {
     // TODO Auto-generated method stub

    }


    });

so yeah my onAnimationEnd code is never executed :(

+1  A: 

Did you call fadein.start()?

Does code (ex. log a message) in onAnimationStart() run?

superuser
Yes I did start that animation previous to this code and the animation runs fine but when it ends it does nothing, you know what maybe its because I'm declaring an entirely new one, I should use the same one I used to play the animation ..ahh I will try this when I get home, it was late last night I must of not been thinking properly :)
Eddiea6987