弹出窗口关闭服务

时间:2011-12-21 20:30:14

标签: android service popupwindow android-input-method

我想在PopupWindow中显示InputMethodService,但是当我使用此代码显示时:

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

有没有人见过这个或知道如何处理它?<​​/ p>

1 个答案:

答案 0 :(得分:0)

您是否有使用AlertDialog / Dialog的 REAL 原因?为什么基于你的代码,一个对话框可以解决这个问题。它将在用户屏幕中间弹出,您可以填充那里的视图。而且,你甚至可以设置听众!