[SOLVED] Android java.lang.NullPointerException at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2922)

If you are getting this in your Android code:

java.lang.NullPointerException             at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2922)

The reason for this could be that you are trying to do some view changes upon animationEnd. This is not allowed so you need to use this trick:

public void onAnimationEnd(Animation animation) {
    new Handler().post(new Runnable() {
        public void run() {

One thought on “[SOLVED] Android java.lang.NullPointerException at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2922)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s