Buttons
とTextViews
を持つLinearLayout
があります。私は、赤から白、赤などのように、私のバックグラウンドを一定の間隔で点滅させたい。今、私はこのコードを試していますが、それは私にnullポインタの例外を与えます。点滅する背景
LinearLayout ll = (LinearLayout) findViewById(R.layout.activity_main);
Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50);
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
ll.startAnimation(anim); // shows null pointer exception at this line
私は間違っていますか?
レイアウトIDを使用している場合は、logcatを添付してください。 –