弹出窗口关闭服务
我试图在 InputMethodService
中显示一个 PopupWindow
,但是当我使用此代码显示它时:
LayoutInflater inflater = ( LayoutInflater ) getSystemService( LAYOUT_INFLATER_SERVICE );
pw = new PopupWindow(
inflater.inflate(R.layout.info_dialog, null, false), 320, 480, true);
pw.showAtLocation(mInputView, Gravity.CENTER, 0, 0);
窗口将在关闭我的 InputMethodService
之前短暂闪烁。
我从 LogCat 得到的错误就是这样的:
12-21 15:22:20.530: E/InputMethodService(4075): Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40a60150
有人以前见过这个或者知道如何处理它吗?
I am trying to show a PopupWindow
within an InputMethodService
, but when I show it using this code:
LayoutInflater inflater = ( LayoutInflater ) getSystemService( LAYOUT_INFLATER_SERVICE );
pw = new PopupWindow(
inflater.inflate(R.layout.info_dialog, null, false), 320, 480, true);
pw.showAtLocation(mInputView, Gravity.CENTER, 0, 0);
the window will flash briefly before closing my InputMethodService
.
The error I get from LogCat is just this:
12-21 15:22:20.530: E/InputMethodService(4075): Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@40a60150
Has anyone seen this before or know how to deal with it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不使用 AlertDialog/Dialog 是否有任何真实原因?为什么根据您的代码,对话框适合这个。它将弹出在用户屏幕的中间,您可以填充那里的视图。而且,您甚至可以为其设置监听器!
Is there any REAL reason why you aren't using an AlertDialog/Dialog? Why based on your code, a dialog would suite this. It will popup right in the middle of the user's screen and you can populate the view that is there. And, you can even set listeners to it!