public class SplashScreen extends Activity {
private static int SPLASH_TIME_OUT = 30000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashScreen.this, MainActivity.class);
startActivity(i);
// close this activity
finish();
}
}, SPLASH_TIME_OUT);
}
Asked
Active
Viewed 2,653 times
1
-
4Check [this](http://developer.android.com/reference/android/view/animation/RotateAnimation.html) – Skynet May 05 '15 at 13:21
-
in this [link](http://stackoverflow.com/questions/3760381/rotating-image-animation-list-or-animated-rotate-android) there are some examples – Manikanta Ottiprolu May 05 '15 at 13:31
-
Do you want to rotate it like a progress bar, infinious animation? Please provide some more info – Bojan Kseneman May 05 '15 at 14:49
-
@BojanKseneman > yes – Rosaline May 14 '15 at 05:20
2 Answers
3
For image rotation use the following codes:
ImageView rotate_image =(ImageView) findViewById(R.id.splash_Rotate);
RotateAnimation rotate = new RotateAnimation(30, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(2500);
rotate_image.startAnimation(rotate);

SID --- Choke_de_Code
- 1,131
- 1
- 16
- 41
1
For API 11+ this should rotate an image around it's centre
yourView.setPivotX(yourView.getWidth() / 2);
yourView.setPivotY(yourView.getHeight() / 2);
float rotation = 360f;
yourView.setRotation(rotation);

Cameron Stobie
- 59
- 1
- 6