Skip to content

Commit

Permalink
Update CommentDialogFragment.java
Browse files Browse the repository at this point in the history
修复软键盘不可弹出问题
  • Loading branch information
limuyang2 authored Dec 20, 2017
1 parent 1013797 commit fb33603
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
sendButton = (ImageView) mDialog.findViewById(R.id.image_btn_comment_send);

fillEditText();
setSoftKeyboard();
// setSoftKeyboard();
commentEditText.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
Log.i("commentEditText","onGlobalLayout");
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);
imm.showSoftInput(commentEditText, 0);
}
});

commentEditText.addTextChangedListener(mTextWatcher);
photoButton.setOnClickListener(this);
Expand Down

0 comments on commit fb33603

Please sign in to comment.