import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
public class Splash extends Activity {
ImageView imageView;
/** Duration of wait **/ private final int SPLASH_DISPLAY_LENGTH = 1000;
/** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_splash);
ImageView bun = (ImageView) findViewById(R.id.splashscreen);
final Animation yAnim = AnimationUtils.loadAnimation(this, R.anim.zoom);
bun.startAnimation(yAnim);
/* New Handler to start the Menu-Activity * and close this Splash-Screen after some seconds.*/ new Handler().postDelayed(new Runnable(){
@Override public void run() {
/* Create an Intent that will start the Menu-Activity. */ Intent mainIntent = new Intent(Splash.this,MainActivity.class);
Splash.this.startActivity(mainIntent);
Splash.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
}
ليست هناك تعليقات:
إرسال تعليق