Android: keyboard flickers when input type EditText - number

I have a layout for list items. Inside this element of the list of layouts, I have text editing with input type as a number.

My problem is when I click on the edit text that the keyboard flickers with a regular alphanumeric keyboard and a numeric key.

I do not understand why this is happening.

layout.xml

  <EditText
                android:id="@+id/edit_quantity"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/total"
                android:layout_centerHorizontal="true"
                android:background="@color/bg_white"
                android:gravity="center"
                android:inputType="number"
                android:maxLength="4"
                android:maxLines="1"
                android:minWidth="@dimen/view_cart_count_min_width"
                android:paddingLeft="@dimen/padding_normal"
                android:paddingRight="@dimen/padding_normal"
                android:textSize="@dimen/text_medium" />

manifest.xml

    <activity
        android:name="com.manoramaonline.entedeal.MyCartActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize|stateVisible" >
    </activity>

when I change softInputMode to adJustPan, the flickirinf keyboard stops, but the screen does not change. So, the keyboard follows the layout.

When android: windowSoftInputMode sets up resizing using text input like edit at the moment the keyboard flickers.

I have a solution that reduces screen size when the soft keyboard is open.

+4
2

. . xml ExitText : inputType = "numberDecimal".

: : windowSoftInputMode = "stateHidden | adjustNothing" , ( ).

28674967.

0

Android: windowSoftInputMode = "stateVisible | adjustPan"

-1

Source: https://habr.com/ru/post/1651742/


All Articles