본문

170706(목) - InputMethodManager.isAcceptingText()

InputMethodManager.isAcceptingText()


problem

Notification direct reply 를 눌러 단어를 입력한 후에, 보내기를 하지않고 Status bar를 올려버리면 앱에서 키보드가 자동으로 내려가지 않았다.


solution

InputMethodManager.isAcceptingText()


isAcceptingText()

Return true if the currently served view is accepting full text edits.


위의 메소드와 


onWindowFocusChanged(boolean hasFocus)

Callback method to be invoked when the window focus changes in the view tree.


사용으로 Direct reply쪽으로 Focus와 Text accepting이 옮겨가는것을 캐치하여 키보드를 닫게 하였다.


if (hasFocus && !imm.isAcceptingText()) {

// hideKeyboard

}


'Mobile > Android' 카테고리의 다른 글

170925(월) - Android thread and Background task understanding  (0) 2017.09.25
170627(화) - Map  (0) 2017.06.27
160510A(화)  (0) 2016.05.10
160504A(수)  (0) 2016.05.04
160405A(화)  (0) 2016.04.05

공유

댓글