我需要在GLSurfaceView
aFrameLayout
中添加 a PopupWindow
。问题是,在内部,SurfaceView
从当前窗口请求令牌。PopupWindows
没有自己的令牌,所以我给它弹出父级的令牌,如下所示:
class MySurfaceView extends GLSurfaceView {
...
@Override
public IBinder getWindowToken() {
// I set the mPopupParent manually to be the parent of the PopupWindow in question
return mPopupParent.getWindowToken();
}
}
...
}
现在,即使MySurfaceView
添加到 aFrameLayout
是PopupWindow
,它也不会在那里绘制。它借鉴了我从中获得令牌的观点。
我怎样才能让它在它实际添加到的布局上绘制?
编辑:只是为了提供更多细节,以防万一,mPopupParent 是一个 IME 视图(本质上是一个键盘)。