在xlistview 底部 重疊一個EditText 初始在程式中讓它隐藏
按下popupwindow評論按鈕後先讓輸入法彈出, 讓評論popupwindow隐藏,顯示EditText
InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
commentPop.dismiss();
editsendLayout.setVisibility(View.VISIBLE);
et.setFocusableInTouchMode(true);
et.requestFocus();
按螢幕時隐藏輸入框
LinearLayout ll = (LinearLayout)convertView.findViewById(R.id.sharefooditem_screen);
ll.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(editsendLayout.getVisibility() == View.VISIBLE) {
editsendLayout.setVisibility(View.INVISIBLE);
InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(et.getWindowToken(), 0);
}
}
});