Friday, 9 December 2011

Frame Animation in Android

animation.xml file:-  (Put This File in anim Folder)

<?xml version="1.0" encoding="utf-8"?> 
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" 
    android:oneshot="false"> 
    <item android:drawable="@drawable/rocket" android:duration="200" /> 
    <item android:drawable="@drawable/rocket" android:duration="200" /> 
    <item android:drawable="@drawable/rocket" android:duration="200" /> 
</animation-list> 


Java Code:-
  
ImageView AndroidImage = (ImageView) findViewById(R.id.android_image); 
AndroidImage.setBackgroundResource(R.drawable.rocket_thrust); 
AndroidAnimation = (AnimationDrawable) rocketImage.getBackground(); 
AndroidAnimation.start();

Enjoy:-)


Don’t forget to provide feedback or follow this blog, if you find this blog is useful.

How to Exit from the Application in Android?

Write Below line on your onClick() Event of Button

moveTaskToBack(true);

and your Application is Closed but Your Activity is Running in Background.

Enjoy :-)


Don’t forget to provide feedback or follow this blog, if you find this blog is useful.