我需要在一个PopupWindow
中的FrameLayout
中添加一个GLSurfaceView
。问题是,内部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
被添加到作为PopupWindow
内容的FrameLayout
中,它也不会在那里绘制。它会在我从中获取令牌的视图上进行绘制。
如何让它在实际添加到的布局上进行绘制?编辑: 为了提供更多细节,以防对结果有影响,mPopupParent是一个IME视图(基本上是一个键盘)。
PopupWindow
吗?我认为你应该改用带有Dialog
主题的普通Activity
。 - a.bertucciaddView
直接将SurfaceViewж·»еЉ е€°WindowManager
еђ—пјџ - Delyan