Android PopupWindow.showAsDropDown报错:BadTokenException: Unable to add window

Android PopupWindow.showAsDropDown报错:BadTokenException: Unable to add window

Android PopupWindow.showAsDropDown报错:

android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?

在show之前前,多加一个判断拦截:

Kotlin 复制代码
你的viewAnchor.windowToken != null

Android PopupWindow_android popupwindow 获取resources-CSDN博客文章浏览阅读287次。代码:package zhangphil.test;import android.content.Context;import android.content.res.Resources;import android.graphics.Color;import android.os.Bundle;import android.support.annotation.Nullable..._android popupwindow 获取resourceshttps://blog.csdn.net/zhangphil/article/details/82850102

相关推荐
晓梦林21 小时前
cp520靶场学习笔记
android·笔记·学习
有味道的男人1 天前
Open Claw对接1688平台
android·rxjava
_李小白1 天前
【android opencv学习笔记】Day 17: 目标追踪(MeanShift)
android·opencv·学习
用户86022504674721 天前
AI 分析头部APP系统优化框架
android
用户86022504674721 天前
AI分析头部APP优化框架
android
2501_916007471 天前
iOS开发中抓取HTTPS请求的完整解决方法与步骤详解
android·网络协议·ios·小程序·https·uni-app·iphone
lvronglee1 天前
【数字图传第四步】Android App查看图传视频
android·音视频
90后的晨仔1 天前
Android 程序入口与核心组件详解
android
90后的晨仔1 天前
Kotlin 简介与开发环境搭建
android
BU摆烂会噶1 天前
【LangGraph】House_Agent 实战(四):预定流程 —— 中断与人工干预
android·人工智能·python·langchain