Skip to content Skip to sidebar Skip to footer

Image Animation In Android

I have to repeat the image sequence I am using with Thread and AnimationDrawable but it is not working continuously. I don't want to stop this animation until next activity is star

Solution 1:

If you want your animation to contiuously run then you need to set android:oneshot="false"

You were saying before to only run through once.

If you want an animation to run until you click the screen to go to the next activity. Start the animation when the onWindowFocusChanged function

@OverridepublicvoidonWindowFocusChanged(boolean hasFocus){
    splashanimation.start();
}

Then use an onTouchEvent to catch the touch, start a new activity and finish the old activity.

@Override
public boolean onTouchEvent(MotionEvent event){
     if (event.getAction() == MotionEvent.ACTION_DOWN) {
          Intent i = new Intent(Anim.this, Main.class);
          startActivity(i);
          finish();
     }
returntrue;
}

Hope this helps, your question is very hard to read/understand.

Post a Comment for "Image Animation In Android"