Skip to content Skip to sidebar Skip to footer

Hide Soft Keyboard On App Resume

I have an Android app, written in c# using Xamarin. I have reduced the app to a LinearLayout containing a TextView and a Google admod AdView for a banner ad. I don't want the soft

Solution 1:

The problem is the EditText, it's getting auto focus when activity is created. To remove that default behavior add this two lines to your root element.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/layout"
    android:descendantFocusability="beforeDescendants"
    android:focusableInTouchMode="true">

Post a Comment for "Hide Soft Keyboard On App Resume"