How to check visibility of software keyboard in Android?
问题 I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android? 回答1: NEW ANSWER added Jan 25th 2012 Since writing the below answer, someone clued me in to the existence of ViewTreeObserver and friends, APIs which have been lurking in the SDK since version 1. Rather than requiring a custom Layout type, a much simpler solution is to give your activity's root view a known ID, say @+id/activityRoot , hook a GlobalLayoutListener into the ViewTreeObserver