title: Android :Unable to add window -- token null is not for an application
body: <p>Getting the error when i am trying to perform on onClickEventOccure in adapter class
   <strong>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</strong></p>
  
  <p>Here the logcat:</p>
  
  <pre><code>07-27 14:53:46.249 30907-30907/com.sgrip E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.sgrip, PID: 30907
  android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
      at android.view.ViewRootImpl.setView(ViewRootImpl.java:583)
      at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:282)
      at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
      at android.app.Dialog.show(Dialog.java:298)
      at com.sgrip.activities.Pending_Request$2.onClickEventOccure(Pending_Request.java:160)
      at com.sgrip.adapter.AdapterNotification$3.onClick(AdapterNotification.java:67)
      at android.view.View.performClick(View.java:4785)
      at android.view.View$PerformClick.run(View.java:19884)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5343)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
  </code></pre>
  
  <p>i am trying to call datepicker dialog on recycleview's listitem but getting this error.</p>
  
  <p>please help me out from this stuck very bad on this....
  thanks in advance.. ...</p>