Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable the android emulator keyboard from popping up

In the following screenshot, I have an image that is followed by a scrollview. The scrollview contains a tablelayout and then some edittext fields, followed by a button

enter image description here

When I want to enter values into my fields, the keyboard pops up and it's blocking my view of the fields, like so:

enter image description here

As you can see, it blocks my view of the edittext fields. Is there an elegant fix for hiding the keyboard? If not, I will change my layout, however I'm not sure what to change. My layout looks like:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#CCCCCC"
    android:weightSum="1" android:id="@+id/llid">
    <TextView ... >
    </TextView> 
    <!-- Image inserted here as an ImageView from my code -->
    <ScrollView 
        android:id="@+id/svid"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="3dp">
        <LinearLayout>
            <TableLayout ... >
                <TableRow>
                    <TextView ... />
                    <TextView ... />            
                </TableRow>
                <TableRow>
                    <TextView ... />
                    <TextView ... />            
                </TableRow> 
                <TableRow>
                    <TextView ... />
                    <TextView ... />            
                </TableRow>                         
            </TableLayout>
            <EditText>  
            ...
            </EditText>
            <EditText>  
            ...
            </EditText> 
            <EditText>  
            ...
            </EditText> 
            <Button>  
            ...
            </Button>                                           
        </LinearLayout>
    </ScrollView>   
</LinearLayout>
like image 514
Joeblackdev Avatar asked Dec 28 '22 16:12

Joeblackdev


2 Answers

My first thought is go to the settings within the emulator:

settings -> language and keyboard and uncheck "Android keyboard" and the other odd ones if they are checked too

like image 137
IZI_Shadow_IZI Avatar answered May 10 '23 15:05

IZI_Shadow_IZI


Since the emulator is suppose to emulate what would be seen on the phone it makes sense that if you are trying to enter values into a text field the keyboard will pop up. I understand it can be irritating but, you should not try to disable it in your code, because that will disable it on the phone and then how will the user enter their inputs?

Also, you can press the hardware back button to dismiss the keyboard when it pops up.

like image 44
Wolfcow Avatar answered May 10 '23 17:05

Wolfcow