Android Fragment 之运行PopupWindow提示 token null is not valid; is your activity running? 由于控件未初始化完成,会导致失败,需要在生命周期方法完成后调用。 建议找一个控件,调用 post方法,进行条用。(post方法可以延迟在所有生命周期完成后执行) bt = (Button)findViewById(R.id.
1. PopupWindow嵌套Spinner报错问题 在PopupWindow中使用Spinner,一点击下拉列表,程序就会崩溃。控制台报错信息如下: Unable to add window -- token android.view.ViewRootImpl$W@c3c9142 is not valid; is your activity running? 解决方式:在Spinner所