Why error is occurring at Animation end?
<p>In my activity I am having several animations. I need to start next  animation at the end of current animation, but sometimes it is showing this error....</p>

<pre><code>02-22 06:56:10.196: E/AndroidRuntime(3125): FATAL EXCEPTION: main
02-22 06:56:10.196: E/AndroidRuntime(3125): java.lang.NullPointerException
02-22 06:56:10.196: E/AndroidRuntime(3125):at com.yakshna.h2h.Food$6$1.onAnimationEnd(Food.java:371)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.animation.Animation.getTransformation(Animation.java:781)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.drawChild(ViewGroup.java:1511)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.View.draw(View.java:6936)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.View.draw(View.java:6936)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.widget.FrameLayout.draw(FrameLayout.java:357)
02-22 06:56:10.196: E/AndroidRuntime(3125):at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1904)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewRoot.draw(ViewRoot.java:1527)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewRoot.performTraversals(ViewRoot.java:1263)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.os.Looper.loop(Looper.java:123)
02-22 06:56:10.196: E/AndroidRuntime(3125):at android.app.ActivityThread.main(ActivityThread.java:3687)
02-22 06:56:10.196: E/AndroidRuntime(3125):at java.lang.reflect.Method.invokeNative(Native Method)
02-22 06:56:10.196: E/AndroidRuntime(3125):at java.lang.reflect.Method.invoke(Method.java:507)
02-22 06:56:10.196: E/AndroidRuntime(3125):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-22 06:56:10.196: E/AndroidRuntime(3125):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-22 06:56:10.196: E/AndroidRuntime(3125):at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>This is the code for that specific view</p>

<p>//touch event for good food
        goodFood_View.setOnTouchListener(new View.OnTouchListener() {</p>

<pre><code>        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub

            badFood_View.setVisibility(View.GONE);
            accepted_To_EatAnimation.reset();
            accepted_To_EatAnimation = new TranslateAnimation(45, 00, 45, 00);
            accepted_To_EatAnimation.setDuration(2000);
            goodFood_View.startAnimation(accepted_To_EatAnimation);
            goodFood_View.bringToFront();
            accepted_To_EatAnimation.setAnimationListener(new AnimationListener() {

                @Override
                public void onAnimationStart(Animation animation) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void onAnimationRepeat(Animation animation) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    // TODO Auto-generated method stub
                    acceptReject_Animation.stop();
                    goodFood_View.setEnabled(false);
                    fadeOut = new AlphaAnimation(1, 0);
                    fadeOut.setInterpolator(new AccelerateInterpolator()); //and this
                    fadeOut.setStartOffset(1000);
                    fadeOut.setDuration(4000);
                    goodFood_View.startAnimation(fadeOut);
                    acceptReject_View.startAnimation(fadeOut);
                    fadeOut.setAnimationListener(new AnimationListener() {

                            public void onAnimationStart(Animation animation) {
                                // TODO Auto-generated method stub

                            }

                            public void onAnimationRepeat(Animation animation) {
                                // TODO Auto-generated method stub

                            }

                            public void onAnimationEnd(Animation animation) {
                                // TODO Auto-generated method stub
                                goodFood_View.setVisibility(View.GONE);
                                acceptReject_View.setVisibility(View.INVISIBLE);
                                foodWelcome_View.setVisibility(View.VISIBLE);
                                welcome_Animation.start();
                                goodFood_Bt.setVisibility(View.VISIBLE);
                                junkFood_Bt.setVisibility(View.VISIBLE);
                                alcohol_Bt.setVisibility(View.VISIBLE);
                            }
                        });

                    }
            });
            return false;
        }
    });
</code></pre>
