我这里有我的启动画面的代码,但是当我在进入主游戏时将启动画面放在我的程序上时似乎是错误的,有人可以帮忙吗?谢谢!
这是我的代码:
public class SpalshScreenActivity extends Activity {
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
StartAnimations();
}
private void StartAnimations() {
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
anim.reset();
LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
l.clearAnimation();
l.startAnimation(anim);
anim = AnimationUtils.loadAnimation(this, R.anim.translate);
anim.reset();
ImageView iv = (ImageView) findViewById(R.id.logo);
iv.clearAnimation();
iv.startAnimation(anim);
anim = AnimationUtils.loadAnimation(this, R.anim.translatez);
anim.reset();
ImageView ib = (ImageView) findViewById(R.id.logo2);
ib.clearAnimation();
ib.startAnimation(anim);}
protected Class<? extends Activity> getFollowUpActivity() {
return BodyPartsGameActivity.class;
}
}