Implementation method of pop-up window and closing of Android monitoring input method
Those who have used IOS know that the input box will be closed automatically when the input method is closed on IOS. How to pop up and close the listening input method on Android? This article provides you with a reliable implementation.
Presentation video address
First, configure in the Android manifest
In this way, the height will be recalculated every time the input method pops up and closes, so as to achieve the effect of pushing the layout up
Then we need to customize a layout and listen for layout size changes
Then put the above custom layout as the following layout into the activity you need, and then bind and listen to events in the activity
In this way, as long as the input method pops up and closes, it can automatically monitor and close the input box, which is very consistent with Apple's experience. This is the end of the introduction. If you have any good ideas, you are also welcome to comment and share some praise! [GitHub demo address]( https://github.com/gupengcheng/CheckSoftInputDemo )