找回密码
 立即注册
android开发 2022-11-20 75 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
PopupWindow望文生义为弹出式菜单,不同于Dialag对话框,PopupWindow不会使宿主activity组件失掉焦点,也就是说PopupWindow弹出后,你可以与宿主activity进行交互,Dialog却不能做到这一点。注意<imgsrc="tongue.gif"smilieid="7"border="0"alt=""/>opupWindow组件的使用问题,PopupWindow是一个堵塞对话框,假如你直接在Activity创建的方法中显示它,则会报错:android.view.WindowManager$BadTokenException:Unabletoaddwindow--tokennullisnotvalid;isyouractivityrunning?总结<imgsrc="tongue.gif"smilieid="7"border="0"alt=""/>opupWindow必须在某个事情中显示或者是打开一个新线程去调用,不能直接在onCreate方法中显示一个Popupwindow,不然永久会有以上的错误。本资料共包括以下附件:

(PopupWindow literally means a pop-up menu. Unlike Dialog, PopupWindow does not lose focus on the host activity component. That is, after PopupWindow pops up, you can interact with the host activity, but Dialog cannot. Note the use of the<imgsrc="tongue. gif" smilieid="7" border="0" alt=""/>opupWindow component. PopupWindow is a blocking dialog box. If you directly display it in the method created by Activity, an error will be reported: android.view WindowManager$BadTokenException:Unabletoaddwindow--tokennullisnotvalid; isyouractivityrunning? Summary<imgsrc="tongue. gif" smilieid="7" border="0" alt=""/>The opupWindow must be displayed in something or a new thread must be opened to call it. You cannot directly display a PopupWindow in the onCreate method, or the above errors will be permanent. This document includes the following annexes:)

[下载]12073670754.rar




上一篇:make money软件
下一篇:工作三年来的ListView相关汇总