title: Unable to add window token android.os.BinderProxy@4250d6d8 is not valid; is your activity running?
body: <p>One user sent me this crash report yesterday:</p>
  
  <pre><code> android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@4250d6d8 is not valid; is your activity running?
      at android.view.ViewRootImpl.setView(ViewRootImpl.java:698)
      at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:326)
      at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
      at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
      at android.view.Window$LocalWindowManager.addView(Window.java:552)
      at android.app.Dialog.show(Dialog.java:277)
      at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
      at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:833)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4867)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>So i searched and it is said that the solution is to change <code>this</code> to <code>Activity.this</code> 
  But this solution didnt work even if i use the following code:</p>
  
  <pre><code>//Oncreate Method.....
  
       button.setOnClickListener(new OnClickListener(){
  
                          @Override
                          public void onClick(View v) {
  
           AlertDialog.Builder alertd = new AlertDialog.Builder(MainActivity.this);
  
           alertd.setMessage("StackOverflow");
  
           alertd.setTitle("Example");
  
           AlertDialog alertd2 = alertd.create();
  
           alertd2.show();
          }
  
                        });
  </code></pre>
  
  <p>Should i change something?</p>