Search code examples
androidsizescreenresolutiondisplay

Android screen vertically desynchronization when run app


Our android app user reported they had display error situation like the picture below, on some tablets like these 2 : Sony Xperia Z3 8 inch, Google nexus 7 2013. Both are Android 6.0.1, 1200x1920 resolution.

Is there any special setting needed to some tablet, Android 6.0.1 or resolution 1200x1920? Or does anyone has similar desynchronization happened on your app?

This display error is not reported on phones. Most of phones' resolution are 1080x1920 or less.

this is the screen shot


Solution

  • We've found the root cause. It's because we use the solution below to detect soft keyboard appearance and then hide some views. When the views are hidden, the value of "activityRootView.getHeight();" will become bigger. So, the threshold of "dpToPx(this, 200)", to check whether soft keyboard appears, need be carefully choose.

    How to check visibility of software keyboard in Android?