Note that there are some explanatory texts on larger screens.

plurals
  1. POFrame layout getting stuck when I hide soft input (Android)
    primarykey
    data
    text
    <p>I have an Android app (fullscreen, landscape), and I have two Views, one is a <code>FrameLayout</code> that's always visible, and one's a <code>LinearLayout</code>. I set the visibility on the <code>LinearLayout</code> to <code>View.GONE</code> right off the bat. When the user taps a button on the <code>FrameLayout</code>, I set visibility on the <code>LinearLayout</code> to <code>view.VISIBLE</code>, and use the <code>InputMethodManager</code> to show the soft input on an <code>EditText</code> in the <code>LinearLayout</code>. This results in both views being shifted up such that the EditText is on screen just above the keyboard. This is all fine.</p> <p>The problem arises when I close the soft input. In the same callback, I set the visibility of the <code>LinearLayout</code> (with the <code>EditText</code>) to <code>View.GONE</code>, and what I'm seeing is the FrameLayout getting stuck on top of the screen (it doesn't shift back down). If I don't GONE-ize the <code>LinearLayout</code>, both Views shift back down just fine. </p> <p>I can work around the issue by starting a timer to wait before setting the visibility to <code>GONE</code>, but I shouldn't have to do that; there should be some notification that I can receive consistently that will indicate when I can hide the <code>LinearLayout</code>. </p> <p>Things I've tried: <code>hideSoftInputFromWindow</code> with a <code>ResultReceiver</code> (result receiver callback gets invoked pretty well immediately (i.e. before the keyboard actually disappears), view is GONEd too quickly, same problem), overriding onLayout for the <code>LinearLayout</code> (doesn't get invoked when the soft input moves the View up and down), overriding other <code>View</code> "on"s. </p> <p>The other really annoying thing is this problem <em>seems</em> to be exclusive to my phone - an AT&amp;T Samsung Galaxy SII Skyrocket running Android 4.0.4 (possibly with some Samsung modifications). I can't repro on a 4.0.3 simulator, nor can anyone else repro on other devices with other Android versions. </p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload