windows包含baiactivity dialog等,activity dialog都能包含view。
getWindowToken
()获取调用的view依附du在哪个window的令牌。
WindowManager会给每一个window一个唯一的令牌。
我是这样写的,出了问题,这个其实就设计到了framework层的WMS了,有兴趣的可以研究一下
getCurrentFocus
().getWindowToken
()
有两种解决方案,一种是try catch 另一种是getWindow().getDecorView().getWindowToken() 完美解决