How to prevent keyboard from opening when activity is opened in android? -


in android app, in profile edit page, when start activity, first edittext field focused (blinking cursor), , keyboard gets displayed.

how can keep being focused on startup (blinking cursor) prevent keyboard showing up? if not possible, not focus edittext on startup.

thanks.

        <edittext             android:id="@+id/textinput_firstname"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:ems="10"             android:inputtype="textpersonname"             android:text="test" /> 

just add line of code in oncreate(...) method

getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -