0

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

これが私のコードです:

        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;
            }
    }
4

1 に答える 1

1

あなたの質問が「なぜそれがスプラッシュ画面から次の活動に進まないのか」であるならば、あなたはそれをするように決して命令を与えません。通常のアクティビティでgetFollowUpActivityを使用すると、呼び出されることがないのはなぜだと思いますか?

特別なアクティビティが必要であるか、スレッドを使用して、特定の時間が経過した後にスプラススクリーンをメイン画面に転送します。

于 2012-07-19T08:00:19.873 に答える