I am debugging a multithreading android app with many activities. In one activity I need to show an AlertDialog. I don't know if this activity is active or not. What should I write in the Builder method of AlertDialog? I have written the following:
new AlertDialog.Builder(getApplicationContext())
but my app crashes after this.
UPDATE: crashes and says
01-02 21:49:13.210: E/AndroidRuntime(23940): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application