how to get "Done" button in android keyboard? - android

I created many emulators but i did not get 'Done' button on emulator.any ideas to solve this problem?
I have attached the screenshot Emulator' Screenshot

Just add two lines in xml:
android:imeOptions="actionDone"
android:singleLine="true"
Done

Try adding android:imeOptions="actionDone" to your EditText.

android:singleLine="true" has been deprecated. Alternatively you could use this:
android:inputType="text"
android:maxLines="1"

Related

How to stop edittext auto suggestion with email input type Programmatically in Android

How to disable auto suggestion with input type : textEmailAddress, while using like below the auto suggestion will appear, exactly want stop auto suggestion with email keyboard.
Used Code
<EditText
android:hint="Logesh"
android:inputType="textEmailAddress|textNoSuggestions|textMultiLine "
android:layout_width="match_parent"
android:importantForAutofill="no"
android:layout_height="match_parent" />
and i tried below also
<EditText
android:hint="Logesh"
android:inputType="textEmailAddress|textVisiablePassword"
android:layout_width="match_parent"
android:importantForAutofill="no"
android:layout_height="match_parent" />
when using textVisiblePassword that input of keyboard "#" not shown.
Thanks in advance !
Add this one in your EditText -
android:inputType="textFilter|textEmailAddress|textNoSuggestions"
and remove android:importantForAutofill="no"
Can you try by adding textFilter property in your android:inputType?
android:inputType="textFilter|textEmailAddress|textVisiablePassword"
android:inputType="textNoSuggestions"
Android has great documentation, check the InputType section of TextViews here
android:importantForAutofill="no"
android:inputType="textEmailAddress"
These two lines worked for me.
I’m not sure it’s exactly what you were looking for, but I needed a way to keep the keyboard layout with the # and shortcuts, but avoid saving the email in the keyboard suggestions for privacy purposes, as it’s for a kiosk app.
In the end I managed it by using:
android:importantForAutofill="no"
android:inputType="textWebEmailAddress"

Android keyboard change enter key

How can I change EditText keyboard enter key like this ?
The solution for me was adding these two lines in the XML of Edittext
android:imeOptions="actionDone"
android:inputType="text"
Thx everyone.
Android have "android:imeOptions" to specify the keyboard action button
1. android:imeOptions="actionGo"
2. android:imeOptions="actionDone"
3. android:imeOptions="actionNext"
4. android:imeOptions="actionPrevious"
5. android:imeOptions="actionSend"
...and more,
you can use based on requirement
Try using android:imeOptions with your EditText in your layout file:
android:imeOptions="actionGo"
use this in your xml where you have define your edittext android:imeOptions="actionDone"

EditText textCapSentences does not work

I try to make text starts with uppercase first letter.
Using attr inputType
<EditText
android:id="#+id/add_user_fname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/margin_size_small"
android:inputType="textCapSentences|textPersonName"
android:capitalize="sentences"
android:layout_toRightOf="#id/user_avatar"
android:hint="#string/add_user_fname"
android:maxLength="#integer/name_max_length"
android:singleLine="true"
android:textSize="#dimen/text_size_small" />
and set in code
userFnameEditText.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
but nothing works.
All of this places in DialogFragment.
Updated
I removed setInputType in code and set only inputType="textCapSentences". It works on Android 4, but doesn't work on Samsung Android 5
I had the same problem. But, I found a solution that help me: Be sure that your "Auto Capitalization" settings is checked on keyboard settings. This works on Nexus 4.
Reference: http://www.ercanbaran.com/textcapsentences-not-working/
Edited
Try it in your java file
TextView txtCapitalize = (TextView) findViewById(R.id.txtCapitalize);
txtCapitalize.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
You should add this line captilaize your letter in EditText
android:inputType="textCapSentences"
I hope this is helpful. ThankYou
To inform you android:capitalize="sentences" is deprecated, So as suggested by other answers you can either use
android:inputType="textCapSentences"
OR
android:inputType="textCapWords"
Both works ! But one for sentence and one for words.
Try this:
android:inputType="textCapSentences"
and
android:capitalize="sentences"
remove textPersonName from xml.
if you add both
android:capitalize="sentences"
and android:inputType="text", in this case it take first and input will not captalized.
android:inputType="textCapSentences"

Android - Get auto suggest on top of keyboard for EditText?

I need edittext with auto suggestion turned on.
For this I am using following in xml :
<EditText
android:id="#+id/edt_description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="#string/description_album_hint"
android:imeOptions="actionNext"
android:inputType="textCapSentences|textAutoCorrect|textAutoComplete"
android:maxLines="2"
android:minLines="2"
android:singleLine="false"
android:textColor="#color/black"
android:textColorHint="#color/hint_color_light_gray" />
Even if I add "textCapSentences|textAutoCorrect|textAutoComplete" as inputType still there are no suggestions.
Adding Screenshot (this is what I need to implement):
Please help me.
Thanks in advance.
For this purpose you need a subclass of EditText called AutoCompleteTextView. You can find an example here http://developer.android.com/guide/topics/ui/controls/text.html#AutoComplete
If you want to get auto suggestions in top of your keypad, what ever you are following is correct. Additionally you can add android:autoText="true". The suggestion will show you all your previously entered words.
Else if you want to get suggestion for every letter you type, then you can use AutoCompleteTextView.
Here is the code, how you can use this.Ex - AutoCompleteTextView
Got it .....
just removing "textAutoComplete" from "textCapSentences|textAutoCorrect|textAutoComplete" worked for me.

Hint in Android

I tried to show a hint in the EditText of my form, but i can't see that hint that i have set in the XML Layout while my application gets deployed, but i can able see the hint in eclipse designer view, but while getting deployed the same hint suppose to appear is missing, i tried with all the possible ways still i could not get the hint in the EditText... This is one of the Edit Text layout that i have used..
<EditText android:id="#+id/SetTimerSec_EditText01"
android:layout_width="60sp"
android:layout_height="40sp"
android:singleLine="true"
android:layout_x="220sp"
android:layout_y="170sp"
android:hint="0"
android:inputType="phone"
android:textColorHint="#color/black"
android:gravity="center"
android:focusableInTouchMode="true" />
[link text][1]
Can anybody Help me..Please
Thanks in advance
[1]: http://imgur.com/PzomF.jpg
[ScreenShot of Designer View with hint displayed][1]
It seems like a SDK bug, or at least related to one.
http://code.google.com/p/android/issues/detail?id=7252
The hint shows up if you remove the following:
android:gravity="center"
add android:ellipsize="start" and your hint will show up and be centered!

Categories

Resources