android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
...
05-15 16:37:31.703: E/AndroidRuntime(845): at com.example.dialogapp_customdialog1.MainActivity.onCreate(MainActivity.java:33)
Steve
Monica Marcus wrote:...But why is "this" a good replacement for "null"? The "this" keyword refers to the current object,
but later on (line 11) I did make a non-null assignment to mContext. It seems that the method getApplicationContext() returns null. Now I see that getApplicationContext() is a public abstract method of the abstract class Context. Oh, It seems that something is wrong here. Perhaps this is the explanation? But why is there no comply about using an abstract method?
Steve
Monica Marcus wrote:Hi, Ulf! The logcat points to the line nr. 22
dialog.show()
It seems that the method getApplicationContext() returns null.
Steve
Consider Paul's rocket mass heater. |