PaulyC
PaulyC

Reputation: 139

Android Soft Keyboard hiding EditText when reopened

I am developing an app that requires screen pinning and a full window so I hide the navigation bar etc.

When the activity opens and the EditText gains focus the Soft Keyboard will become visible and it will shift the EditText above it -- Great, no problems there.

The issue appears when I dismiss the Soft Keyboard and reopen it by clicking on said EditText, the Soft Keyboard will now hide the EditText.

Any ideas on how I can resolve this? I have tried containing the entire layout inside a ScrollView and the issue is still happening.

Window flags being used:

 val flags = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
        or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
        or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
        or View.SYSTEM_UI_FLAG_FULLSCREEN
        or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)

 window.decorView.systemUiVisibility = flags
 window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)

Inside my Manifest I use:

android:windowSoftInputMode="stateHidden|adjustResize"

Initial display of Soft Keyboard

When Soft keyboard is dismissed and reopened

SOLVED.

I managed to resolve this by removing the input type from the EditText.

Upvotes: 1

Views: 557

Answers (1)

PaulyC
PaulyC

Reputation: 139

I managed to solve this by removing the input type from the EditText.

Upvotes: 2

Related Questions