0

当我尝试手动编辑值时,我在调试器上收到此错误:生成的值 (int) 与声明的类型 (android.view.View) 不兼容

    final View l = findViewById(R.id.GameplayLayout);
    Animation a = AnimationUtils.loadAnimation(MainActivity.this,
    android.R.anim.fade_out);
    a.setAnimationListener(new AnimationListener() {
        public void onAnimationEnd(Animation animation) {
            fadein();
        }

        public void onAnimationRepeat(Animation animation) {
        }

        public void onAnimationStart(Animation animation) {
        }

    });
    l.startAnimation(a);

它选择:

    l.startAnimation(a);

作为错误行,在调试器中它说:

    l = null;

为什么要这样对我?:(

谢谢!

我不得不使用 R.id.startscreen ......失败......对不起!

4

1 回答 1

-1

setContentView(R.layout.GameplayLayout)在查找视图之前尝试调用。

于 2012-05-06T23:44:42.887 回答