try this attribute for activity in AndroidManifest.xml
android:windowSoftInputMode="stateHidden|adjustPan"
it should look something like this.
<activity android:name="com.myexample.TestActivity" android:label="@string/login_screen" android:screenOrientation="portrait"
the attribute you want to play with is windowSoftInputMode to try different values, as you may need a different output after a certain time.
adjustPan
The main operation window does not change to make room for a soft keyboard. Rather, the contents of the window automatically expand so that the current focus is never hidden by the keyboard, and users can always see what they are typing. This is generally less desirable than resizing, as the user may need to close the soft keyboard to receive and interact with the shaded parts of the window.
adjustResize
The main activity window always changes to make room for the on-screen keyboard.
stateHidden
The soft keyboard is hidden when the user selects an action, that is, when the user positively moves forward to activity, and does not access it due to the abandonment of another action.
You can find more information on activity item documentation.
Update
I wrote something that can help you, the layout is available on layout
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="activities.list.first.TestLayoutActivity"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:layout_weight="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.6" android:orientation="vertical"> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New Text" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.4" android:orientation="vertical"> <AutoCompleteTextView android:id="@+id/TestLayoutActivity_autoCompleteTextView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:completionThreshold="1" android:drawableLeft="@android:drawable/ic_menu_search" android:text="" /> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /> </LinearLayout> </LinearLayout> </ScrollView> </LinearLayout>
AndroidManifest.xml
<activity android:name="activities.list.first.TestLayoutActivity" android:label="@string/title_activity_test_layout" android:windowSoftInputMode="stateHidden|adjustPan" />
The code is in code
String[] list = {"match1", "match2", "match3", "match12", "match11", "match8", "match7", "match4", "match13", "match10", "match9", "match6", "match5",}; AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.TestLayoutActivity_autoCompleteTextView); ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), R.layout.simple_list_item_1, list); autoCompleteTextView.setAdapter(adapter); Before

After
[ ![after]](https://fooobar.com/undefined)