1

I need to create an animation in android,i have one fixed image in the screen, i need to add another image over the previous image using fade in and out.

i have searched and i found something like this

Fade in and out in java

That is the concept, but can i add different image using this method,i have tried simple animation technique also but that is working in every version.

Could somebody help me @Thanks

Community
  • 1
  • 1
  • 1
    Why not you are viewing the API DEMO section given by Android.. There is alot of animations .. – Pankaj Kumar May 29 '13 at 06:33
  • 1
    Goto sdk->samples->ANDROID_VERSION->ApiDemos and find a package for animation. If you want to real time check start emulator. you will see the API Demo application, start and check animations – Pankaj Kumar May 29 '13 at 06:42
  • refer this link http://www.example8.com/category/view/id/15551 – Sunil Kumar May 29 '13 at 06:45
  • Check Frame Animation: http://stackoverflow.com/questions/6125936/android-change-picture-every-10-seconds – Mikalai Daronin May 29 '13 at 06:50
  • @lassana i have tried that but its working fine in 4.0 version but not in 2.2,2.3 –  May 29 '13 at 06:59
  • @PankajKumar thanks i found it i need to know that without onclick,fadein and out in certain time interval –  May 29 '13 at 07:06
  • @sunil thanks i need to know that without onclick,fadein and out in certain time interval –  May 29 '13 at 07:07

1 Answers1

0

try this:

public class MyAnimationListener implements AnimationListener {

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

        i.setImageResource(R.drawable.bg);
        i.startAnimation(animo);

    }

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

    }

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

    }

}

In Second Activity:

MyAnimationListener mListener = new MyAnimationListener();
        anim.setAnimationListener(mListener);
        i.startAnimation(anim);
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
  • in your first animation put your fixed image and on end of first animation put your second animation with second image and start it. – Sagar Maiyad May 29 '13 at 06:44