Java tutorial
//package com.java2s; import android.os.Handler; import android.widget.PopupWindow; public class Main { private static PopupWindow mPop; private static Handler mHandler; public static void init() { mHandler = new Handler() { public void handleMessage(android.os.Message msg) { mPop.dismiss(); }; }; } }