The next button on the keyboard does not appear

I want the user, and then instead of the arrow key, to show the next button on the keyboard. Therefore, the user does not need to press the back button to enter the next edittext.

Added layout:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="#D5D5D5" android:orientation="vertical" > <FrameLayout android:id="@+id/topLinearLayout" android:layout_width="fill_parent" android:layout_height="45dip" android:background="@drawable/bar" > <ImageView android:id="@+id/new_quote_imageView" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/new_quote_bar" /> <TextView android:id="@+id/contactUs" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" android:gravity="center" android:text="@string/contact_us" android:textColor="@android:color/white" android:textSize="15sp" /> </FrameLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="vertical" > <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dip" > <LinearLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight=".7" android:background="#EEEBE6" android:orientation="vertical" android:padding="15dip" > <TextView android:id="@+id/nameTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:text="@string/name" android:textColor="@android:color/black" android:textSize="16sp" /> <EditText android:id="@+id/nameEditText" android:layout_width="fill_parent" android:layout_height="40dip" android:layout_marginTop="10dip" /> <TextView android:id="@+id/emailTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:text="@string/email" android:textColor="@android:color/black" android:textSize="16sp" /> <EditText android:id="@+id/emailEditText" android:layout_width="fill_parent" android:layout_height="40dip" android:layout_marginTop="10dip" android:inputType="textEmailAddress" /> <TextView android:id="@+id/commentsTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:text="@string/comments" android:textColor="@android:color/black" android:textSize="16sp" /> <EditText android:id="@+id/commentsEditText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:lines="5" /> <View android:layout_width="fill_parent" android:layout_height="1dp" android:layout_marginTop="5dip" android:background="@android:color/darker_gray" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_marginBottom="10dip" android:layout_marginTop="10dip" android:gravity="right|center_vertical" android:weightSum="1" > <Button android:id="@+id/submitButton" android:layout_width="0dip" android:layout_height="35dip" android:layout_weight=".3" android:background="@drawable/button_background" android:text="@string/submit" android:textColor="@android:color/white" android:textSize="16sp" /> </LinearLayout> </LinearLayout> </LinearLayout> </ScrollView> </LinearLayout> </LinearLayout> 

Please help me with this.

Thanks in advance.

+8
android
source share
7 answers

add this line to your edittext xml

 android:singleLine="true" 
+16
source share

If you don’t want multiple lines to just add

 android:singleLine="true" 

else, please use this solution

  <EditText android:id="@+id/commentsEditText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:imeOptions="actionNext" android:lines="5" /> 

I added

  android:imeOptions="actionNext" 

this line additionally, use this in each EditText that you want to have the next button on the softkey bar

+10
source share

Define the input type for each edit text.

 <EditText android:id="@+id/editText" android:inputType="textPersonName" /> 
+3
source share

Try adding this to your edit text:

 android:singleLine="true" 
+1
source share

android: singleLine = "true" // deprecated

use android: maxLines = "1" and imeOptions

  android:maxLines="1" android:imeOptions="actionNext" 
+1
source share
 Simply use android:inputType="textNoSuggestions" android:maxLines="1" and remove if you have used digits. android:digits 
+1
source share

Add the line below to the text edittext

 android:imeOptions="flagNavigateNext" 

Example below:

 <EditText android:id="@+id/commentsEditText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:lines="5" android:imeOptions="flagNavigateNext"/> 
0
source share

All Articles