1
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);
}
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
Rosaline
  • 51
  • 2
  • 7

2 Answers2

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);