title: Android - NullPointerException with popup window
body: <p>I have a pop up window in my application and once I got the following <code>NullPointerException</code> while testing. But my code is nowhere in the stack trace.</p>
  
  <pre><code>/dalvikvm(15212): threadid=1: thread exiting with uncaught exception (group=0x409f71f8)
  E/AndroidRuntime(15212): FATAL EXCEPTION: main
  E/AndroidRuntime(15212): java.lang.NullPointerException
  E/AndroidRuntime(15212):    at android.view.View.onDetachedFromWindow(View.java:9709)
  E/AndroidRuntime(15212):    at android.widget.TextView.onDetachedFromWindow(TextView.java:4492)
  E/AndroidRuntime(15212):    at android.view.View.dispatchDetachedFromWindow(View.java:9818)
  E/AndroidRuntime(15212):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2266)
  E/AndroidRuntime(15212):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2266)
  E/AndroidRuntime(15212):    at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2248)
  E/AndroidRuntime(15212):    at android.view.ViewRootImpl.doDie(ViewRootImpl.java:3707)
  E/AndroidRuntime(15212):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2584)
  E/AndroidRuntime(15212):    at android.os.Handler.dispatchMessage(Handler.java:99)
  E/AndroidRuntime(15212):    at android.os.Looper.loop(Looper.java:137)
  E/AndroidRuntime(15212):    at android.app.ActivityThread.main(ActivityThread.java:4424)
  E/AndroidRuntime(15212):    at java.lang.reflect.Method.invokeNative(Native Method)
  E/AndroidRuntime(15212):    at java.lang.reflect.Method.invoke(Method.java:511)
  E/AndroidRuntime(15212):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  E/AndroidRuntime(15212):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  E/AndroidRuntime(15212):    at dalvik.system.NativeStart.main(Native Method)
  W/ActivityManager( 1195):   Force finishing activity com.android.contacts/.activities.PeopleActivity
  </code></pre>
  
  <p>Can anyone help me find the root cause?</p>