日常问题记录

2019-07-09  本文已影响0人  蝴蝶AD

布局错误:
The layout <layout> in layout has no declaration in the base layout folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier
解决方法:File - Invalidate caches/Restart - Invalidate and Restart


popwindon、dialog弹出Activity窗口不存在:
unable to add window -- token null is not valid; is your activity running 错误解决办法
解决办法:
使用onWindowFocusChanged(boolean hasFocus)的时机显示
结合延迟使用:
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (inputBoardService != null&&!isFinishing()) {
inputBoardService.setKeyboardBackgroud();
}
}
// 延迟加载popupwindow,如果不加延迟就会报错
view.postDelayed(new Runnable() {
@Override
public void run() {
showAtLocation(view, Gravity.NO_GRAVITY, 0, 0);
}
},15);

上一篇 下一篇

猜你喜欢

热点阅读