i have here the code for my splash screen but it seems to be wrong when i put my splash screen on my program when going to the main game, anyone can help? thanks!
here’s my code:
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;
}
}
If your question is “why does it not progress from splash screen to the next activity”…. you never give a command to do that. Why do you think that having a getFollowUpActivity on a normal Activity does ever get called?
you need a specialized Activity or use a thread to forward your splasscreen to the main screen after a specific time.