When i creating view, i.e. ListView, and place there EditView it shows me keyboard when Activity starts, but i think my users don't need this so...

How It Works

Get an answer in three easy steps. Here's how it works...

Ask Your Question

1. Ask Your Question

Enter your smartphone question at the top of this page and click Get An Answer.

Pick Your Priority

2. Pick Your Priority

Tell us how quickly you want your smartphone question answered.

Get An Answer

3. Get An Answer

Connect with your Smartphone tech via online chat or telephone call.

Answer

Customer

When i creating view, i.e. ListView, and place there EditView it shows me keyboard when Activity starts, but i think my users don't need this so often as Developer think. I tried

EditText.setSelected(false);

but not very successfull. Can anyone help?
Thanks in advance.

Posted
Alexey Schekin
Smartphone Tech

Hello!
You can use few methods to change this behaviour of EditText.
First - you can define in xml layout this parameters:

<LinearLayout
    android:focusable="true" android:focusableInTouchMode="true"
    android:layout_width="0px" android:layout_height="0px"/>

<!-- :nextFocusUp and :nextFocusLeft have been set to the id of this component
     to prevent the dummy from receiving focus again -->
<AutoCompleteTextView android:id="@+id/text"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:nextFocusUp="@+id/text" android:nextFocusLeft="@+id/text"/>

AutoCompleteTextView also as EditText can be set as an example.
Second - If it's the problem of the virtual keyboard, that popup by gain focus on element, see the AndroidManifest.xml element documentation.

android:windowSoftInputMode="stateHidden" - always hide it when entering the activity

or android:windowSoftInputMode="stateUnchanged" - don't change it (e.g., don't show it if it isn't already shown, but if it was open when entering the activity, leave it open).

Posted
Customer

Thanks for the help with this little problem:) I set
android:focusable="true" android:focusableInTouchMode="true"
and it's works for me :)

Posted

quoteTestimonialsquote

About ExpertHelp

ExpertHelp is changing the way you connect with service professionals.

Whether you have a quick question while preparing your taxes, troubleshooting a computer problem, or need to hire an attorney, ExpertHelp is the most convenient and affordable way to connect with the right service professional to get the job done.

ExpertHelp has been in business since 2011, is an A+ Rated Better Business Bureau accredited member, and offers a 100% satisfaction guarantee on every question you ask!

More Smartphone Questions...

Ask Your Smartphone Question & Get An Answer Now!