Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”

Instead of :
Context appContext = this.getApplicationContext();
you should use a pointer to the activity you’re in (probably this).

I got bitten by this today too, the annoying part is the getApplicationContext() is verbatim from developer.android.com 🙁

Leave a Comment