哎呀!奇怪问题,看看我发帖的时间吧。edittext关闭软键盘

wenh7788 2014-11-07 01:25:40
我在一个Activity 里面有一个popupwindow
popupwindow 上面四个edittext 之允许输入数字

我不知道为什么当我操作完之后
关闭了数字的键盘,但是又有26的键盘(我用的是26的键盘)

我感觉怎么会是弹出了两个键盘?
非常奇怪

我想在 popupwindow dismiss的时候关闭软件盘可是实现不了啊(也是就是关闭不了后面的26键盘)
奇怪!!!!

我的代码

LayoutInflater layoutInflater=LayoutInflater.from(FlowPurchaseActivity.this);
View popupView=null;
popupView=layoutInflater.inflate(R.layout.activity_flowpurchase_search, null);
popupView.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
if (mPopupWindow != null && mPopupWindow.isShowing()) {
mPopupWindow.dismiss();
mPopupWindow = null;
}
}
});

//popupView.setBackgroundColor(Color.argb(50, 127, 127, 127));
DisplayMetrics dmDisplayMetrics=new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dmDisplayMetrics);
mPopupWindow=new PopupWindow(popupView, dmDisplayMetrics.widthPixels, dmDisplayMetrics.heightPixels);
mPopupWindow.setOutsideTouchable(true);
mPopupWindow.setFocusable(true);//这个属性决定gridview能否点击
mPopupWindow.setTouchable(true);

mPopupWindow.update();

mPopupWindow.setOnDismissListener(new OnDismissListener() {

@Override
public void onDismiss() {

InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(FlowPurchaseActivity.this.getCurrentFocus().getWindowToken()
,InputMethodManager.HIDE_NOT_ALWAYS);

//int flags = WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
//getWindow().addFlags(flags);
}
});


看我加班熬夜的基础上,求帮忙!!!!
...全文
224 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wenh7788 2014-11-08
  • 打赏
  • 举报
回复
我的两个edittext inputtype 都是数字的。但是第二个弹出的键盘是 26键的。
wenh7788 2014-11-08
  • 打赏
  • 举报
回复
帮忙看看啊?搞不定了。
Darcy杨 2014-11-07
  • 打赏
  • 举报
回复
看看是不是另外几个edittext获取了焦点导致又弹出来输入法吧,比如把所有的edittext的inputType都变成数字,看这次弹出的第二个输入法是不是也变成数字了。

80,349

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧