1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question EditText in landscape mode 'feature'

Discussion in 'Android Questions' started by agraham, May 27, 2019.

  1. agraham

    agraham Expert Licensed User

    I've searched the forum for this and found nothing, but maybe I can't frame the search term properly!

    In a couple of my apps, and some from the store as well, when an activity is in landscape mode tapping an EditText control replaces the EditText by some sort of input control that occupies the entire space above the keyboard with a 'Done' button to the right.

    An Internet search indicates that adding this line to the manifest might stop this and show the EditText as it does when in portrait mode.
    Code:
    AddManifestText(<edtSource android:imeOptions="flagNoExtractUi|flagNoFullscreen" />)
    However this doesn't seem to work. Has anyone else experienced this and found a work around?

    EDIT: Perhaps this doesn't work because the EditText is added by code rather than xml. I'll carry on looking for a possible solution using Reflection.
     
    Last edited: May 27, 2019
  2. agraham

    agraham Expert Licensed User

    This works but seems to have side effect of altering the height of the Activity after rotating to landscape and back to portrait, but I haven't characterised exactly what happens yet.
    Code:
    Dim jo As JavaObject
    jo = edtSource
    jo.RunMethod(
    "setImeOptions"Array(33554432)) ' IME_FLAG_NO_FULLSCREEN
     
    Last edited: May 28, 2019
  3. agraham

    agraham Expert Licensed User

    Ah! The above effect only happens if you rotate the device with the soft keyboard open. I can live that however, it's better than nothing.

    EDIT: Also this seems to happen only on a multi-line EditText
     
    Last edited: May 28, 2019
    stevel05 likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice