old question: "Why does creating a Toast crash my application?"
My application runs fine if I don't use toasts but if I want to create and show a simple Toast like this:
Toast SimpleToast = Toast.makeText(getApplicationContext(), "Just a toast.",Toast.LENGTH_LONG);
SimpleToast.setGravity(Gravity.TOP, 0, 0);
SimpleToast.show();
I get these lines in the log and then the app crashes:
NotificationService enqueueToast pkg=games.MyAppName callback=android.app.ITransientNotification$Stub$Proxy@49603368 duration=1
ResourceType No package identifier when getting name for resource number 0x00000000
AndroidRuntime Shutting down VM
dalvikvm threadid=3: thread exiting with uncaught exception (group=0x4001b188)
AndroidRuntime Uncaught handler: thread main exiting due to uncaught exception
AndroidRuntime java.lang.NullPointerException
I've checked and double checked the code above is what makes it crash. I'm running on the emulator as I currently don't have an android phone.