使用PopupWindow出现的错误

来源:互联网 发布:妙味课堂js视频下载 编辑:程序博客网 时间:2024/05/07 17:55

转自:http://bbs.csdn.net/topics/370055202?page=1#post-393445257

报 错:

at android.widget.PopupWindow$PopupViewContainer.dispatchKeyEvent


解决:

创建PopupWindow 的时候 不要调用 setFocusable(true);
在showAtLocation后在调用setFocusable(true);

并且在 dismiss的时候 调用setFocusable(false);