解决android报错IllegalArgumentException: parameter must be a descendant of this view

来源:互联网 发布:手机刷q币软件 编辑:程序博客网 时间:2024/06/05 20:20

 转载地址

总的来说,出现这个问题的原因是,页面被销毁了,但是控件还是占用着焦点。

详细解释,参考:关于ViewFlow和GridView嵌套导致Parameter must be a descendant of this view

解决办法就是页面销毁的时候,同时取消焦点。

View currentFocus = getCurrentFocus();if (currentFocus != null) {        currentFocus.clearFocus();}


0 0
原创粉丝点击