i have a layout which the user need to write his detailes in some editText which placed in a vertical linearLayout.
however, everyTime the user need to open the keyboard, write something on the editText and then to click on the back button in android and again click on the next editText and write his detailes and again over and over.
i want to implement that instead of opening and closing the keyboard, instead of the enter button on keyboard i will have a next Button that after the user entered his detailes on a spesific EditText , it will skip to the next EditText without closing and opening the keyboard every time.
i saw that there is some apps that has this feature, however i didnt find how can i implement it
thanks alot
here is the example of my layout:
<LinearLayout
android:layout_width="283dp"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:orientation="vertical" >
<TextView
android:id="@+id/aaa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="aaaa" >
<requestFocus />
</TextView>
<EditText
android:id="@+id/bbb"
android:layout_width="match_parent"
android:layout_height="36dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="bbb" />
<TextView
android:id="@+id/cccc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="ccc" />
<EditText
android:id="@+id/emailTextGroup"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="@+id/dd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="ddd" />
<EditText
android:id="@+id/fff"
android:layout_width="match_parent"
android:layout_height="38dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="fff" />
<TextView
android:id="@+id/yyy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="yyy" />
<EditText
android:id="@+id/eeee"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="@+id/yyyy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="iii" />
<EditText
android:id="@+id/ooo"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="@+id/ppp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="ppp" />
<EditText
android:id="@+id/sss"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@drawable/text_back"
android:ems="10"
android:inputType="textMultiLine" />
</LinearLayout>
addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start,int before, int count) { // TODO Auto-generated method stub if(et1. getText(). toString(). length()==size) //size as per your requirement { et2.
The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font (e.g., on a handheld device), the sizes will be in proportion.
First you need to set the android:imeOptions attribute equal to actionDone for your target EditText as seen below. That will change your 'RETURN' button in your EditText's soft keyboard to a 'DONE' button. Save this answer.
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
You should add in the XML
file an attribute to your EditText
s:
android:imeOptions="actionNext"
.
The next button will bring the user into the next field that can receive input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With