ここにスプラッシュ画面のコードがありますが、メインゲームに行くときにプログラムにスプラッシュ画面を配置すると間違っているようです。誰か助けてくれますか?ありがとう!
これが私のコードです:
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;
}
}