0
我试图表现出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 = [email protected]
有没有人见过这个或不知道如何处理呢?
真正的原因是在我的问题的第一行。我在InputMethodService中。对话框不能用于服务。 – coder 2012-01-19 14:18:15
恩,是的,他们可以。所有你需要的是上下文。除非,“InputMethodService”是一些“特殊”的服务。我怀疑。我会研究它。 – JoxTraex 2012-01-19 15:43:09
嗯,我错了,你不能直接这样做,但你可以从你的服务发送一个意图到你的活动来处理启动该对话框,检查我的更新后的帖子。 – JoxTraex 2012-01-19 16:21:40