android-edittext

Hide soft keyboard on pressing back

这一生的挚爱 提交于 2019-12-10 13:03:23
问题 I have an EditText in an Activity and I want it to be active and soft-keyboard be open when I open that Activity . Here is my xml for EditText : <EditText android:background="@null" android:cursorVisible="true" android:elegantTextHeight="true" android:enabled="true" android:focusable="true" android:hint="Search" android:id="@+id/editText11" android:inputType="textNoSuggestions|textCapSentences" android:layout_centerVertical="true" android:layout_height="wrap_content" android:layout_width=

EditText's selectAll() does not select the text, instead cursor is moved to position 0

China☆狼群 提交于 2019-12-10 12:59:11
问题 My situation is: I have a EditText , and under it I have a button, called "select all". It's purpose is to let the user select all the text by pressing it. When the button is clicked, I invoke selectAll() on the EditText , but instead of selecting all text, in some cases (generally, when the cursor is already positioned within the text somewhere), the cursor is moved to position 0 (start of text) and text remains unselected. Second click on the button will then select all. But of course it

Display a message inside Android Edit Text Field

我们两清 提交于 2019-12-10 12:58:36
问题 Hai, I have an Android Program with one text field. I need to display a message inside that textfield when it loads on an emulator. When the user clicks inside that textbox that message should dispappear. For Ex: Please enter name Can any one post some sample code over here... 回答1: Just use or call setHint on the object. Hint text to display when the text is empty. <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="18px" android:gravity="left"

Android EditText/TextView how to make each word start with uppercase and all remaining characters of words to be lowercase

ぃ、小莉子 提交于 2019-12-10 12:41:57
问题 I have already used following options to make each starting letter of a word Uppercase <EditText android:inputType="text|textCapWords"/> While typing the user has option on the keyboard to change the case of letter i.e. the user with this option can easily type lowercase letters. Further,I want text on my EditText to be on this format Each Starting Letter Of A Word Must Be In Uppercase And All Other Letter Of The Word Be In Lowercase . Meaning,when the user inputs each StArting LeTTer of a

Android: multiline edittext and keyboard problems

依然范特西╮ 提交于 2019-12-10 12:39:58
问题 i have this edittext: <EditText android:inputType="textMultiLine|textCapSentences" android:layout_width="fill_parent" android:layout_height="240dp" android:scrollHorizontally="false" android:imeOptions="actionNone" android:minLines="9" android:scrollbars="vertical" android:singleLine="false" android:gravity="top" android:layout_gravity="center_vertical|left" android:nextFocusForward="@+id/costo_dettagli" android:layout_weight="1" android:id="@+id/dettagli" android:textSize="20sp" /> and this

Edit text first time to input a letter validation

耗尽温柔 提交于 2019-12-10 12:27:10
问题 I'm creating an application that checks if the user inputs a letter or a number then a button will pop-out. And if the user didn't enter a single letter a validation will show. Here's an example of what I'm trying to debug[main activity. PS. not my real code]: private EditText edittext; Button checkBtn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); addKeyListener(); } public void addKeyListener() { edittext =

Outer glow in edittext

柔情痞子 提交于 2019-12-10 12:17:27
问题 I'm trying to make outer grow in edit text view for better look for user experience. I tried some of the method to get this result. On of the example is: <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dip" android:ems="10" android:gravity="top" android:inputType="textMultiLine" android:shadowColor="#003399" android:shadowDx="0" android:shadowDy="0" android:shadowRadius="3"> But it didn't give the result.

Remove Delay for android textPassword

╄→尐↘猪︶ㄣ 提交于 2019-12-10 11:47:12
问题 While enterting password inside EditText view, Characters are being shown and after some delay it is shown as DOT, i want to remove this delay. It should be displayed directly as DOT. How do i do this on Android? 回答1: This is a user setting within Android, I do not believe that it is controllable from code. It is designed to aid the user in entering the correct password. --Edit-- Further to the question askers comment, the setting can be found in: Settings > Security > Make passwords visible

Capture entire content of EditText into a picture

不想你离开。 提交于 2019-12-10 11:17:52
问题 I have to print the entire text of a text field into a picture. The reason is: I have to exchange messages with unsupported UTF-8 characters between Android and other web clients. By unsupported UTF-8 characters I mean missing fonts in Android (see this topic here ). I tried to use the direct way Bitmap b; EditText editText = (EditText) findViewById(R.id.editText); editText.buildDrawingCache(); b = editText.getDrawingCache(); editText.destroyDrawingCache(); which works like a charm until I

How do you hide floating action buttons from the keyboard?

若如初见. 提交于 2019-12-10 11:14:00
问题 I have FloatingActionButtons and FloatingActionMenus in CoordinatorLayouts, but I also have some EditTexts in there too, with the adjustPan window mode. But when I go to click the EditTexts, the floating buttons/menus come up along with the keyboard and somewhat block the visible area (such as the row containing the EditText). Can I somehow prevent the floating items from coming up with the keyboard? 回答1: There is a library which can listen to keyboard visibility, if the keyboard is visbile