android-edittext

Hint Not Displaying When numeric=“integer” in EditText

风流意气都作罢 提交于 2019-12-06 01:38:36
The title is the question. Anybody know any solution? Please help me. Shaiful The XML attribute android:numeric is not a boolean value and "true" is not a valid parameter, it must be one ore more of "integer", "signed", "decimal". Per the sample you've posted, your issue is due to the choice of adding gravity to center the text. There is a known bug in the SDK that, as of 2.3, it looks like is still not fixed. This bug hides the hint text when android:singleLine and any custom value of android:gravity are set together. Your choice at this juncture really is to remove one or the other. Some

Android: catching action for keyboard enter button being pressed

孤者浪人 提交于 2019-12-06 01:27:38
问题 I am trying to respond to pressing the enter button on a standard system on screen soft keybord, in numeric mode. keyboard appears on the screen when myCustomEditText class is given focus. tried 2 approaches: overriding onKeyDown() : public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { //do sth.. return true; } return super.onKeyDown(keyCode, event); } setting listener setOnKeyListener : myCustomEditText.setOnKeyListener(new OnKeyListener() { public

How to make Edittext size stay put? Android

北战南征 提交于 2019-12-06 00:50:02
I know the attribute which makes the text "disapear" on the left part of the Edittext to maintain a single line, (singleLine="true"). But my issue is when I fill the edittext before the view is displayed... in this case, my edittexts are all going out of the screen... any ideas? thx! This is what is get when fill the empty Edittext. Everything stays put, and the text is vanishing on its left side Screenshot and when I prefill from my DB Screenshot here is the code of the edittext : <EditText android:id="@+id/InscripChampNom" android:layout_height="wrap_content" android:textSize="14px" android

setText doesn't set text to EditText

爷,独闯天下 提交于 2019-12-06 00:19:48
问题 I'm having a problem that I've never had before in almost three years of developing with Android... I want to take a picture and after the picture is taked, the EditText s of the activity become clear. What I'm doing is set the values of the EditText to Strings using getText().toString() to restore them after taking the picture. The strings are stored perfectly with the data, but when I use setText , it doesn't work... The strange thing is that setHint works! How can it be? Here's the code I

Line Numbers, Code Highlighting in TextView

吃可爱长大的小学妹 提交于 2019-12-06 00:09:22
I'm working on an 'IDE' for Android - it could be useful for editing short scripts / making quick adjustments to files. At the moment I'm just using a simple EditText, but I am wanting to add several features, for example Line Numbering down the left hand side of the EditText and Code Highlighting. Does anyone have any suggestions about how to approach this? For the code highlighting, I'm guessing I'll need to write my own subclass of EditText. For the line numbering, could I have a thin vertical TextView that has the same text size as the EditText?? Yes, I'm aware editing code on a mobile

Disable/Remove Text Select Handle from EditText in Android

杀马特。学长 韩版系。学妹 提交于 2019-12-05 23:54:08
问题 When user click on EditText the cursor comes up with the Text Select Handle. Text Select Handle can move around to a different position in the field. Text Select Handle is Is there a way you can remove that so it does not show up? 回答1: To resolve this issue i have created an empty image in shape. <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <size android:height="0dp" android:width="0dp" /> </shape> and

How to stop taking input after EditText length crosses a limit

跟風遠走 提交于 2019-12-05 23:43:50
问题 I know there are a couple of questions already been asked, but I have a little different query. How do we put a limit on the maximum number of characters to be inputted in EditText ? Whether I do this android:maxLength="7" or this ((EditText)findViewById(R.id.zip)).setFilters(new InputFilter[] { new InputFilter.LengthFilter(7) }); I can still type into the text field, though it's not visible and not taken into account. If I keep typing, the input becomes invisible after the limit, but the

Same fragments, edittext and requestfocus issue

元气小坏坏 提交于 2019-12-05 23:39:34
问题 Sorry for asking another time help on this matter, but all others posts didn't help. Here's the scenario: I have a Acivity ('A') that incorporates a Layout with a fragment inside. This fragment is swapped on user input. One of this fragments has a edittext inside, which I want to get focus on creation AND show the damn soft keyboard. So, in the onCreateView() of the fragment I use: mEt = (EditText) v.findViewById(R.id.et); mEt.setImeOptions(EditorInfo.IME_ACTION_DONE); mEt.requestFocus(); So,

How to set Material design style to disabled EditText (android)?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 23:33:24
问题 I'm trying to make my disabled EditText's style like in guidelines: https://www.google.com/design/spec/components/text-fields.html#text-fields-labels <EditText android:id="@+id/account_number" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/test_account" android:enabled="false" /> I've already implemented material design styles, so all my widgets look material. The question is: Is there any way to get this dotted underline using styles , without

How to limit the text in numbers only from 0-59 in Edit Text in Android?

狂风中的少年 提交于 2019-12-05 23:28:34
问题 I have an Edit Text in which the number can only between 0-59 , No other numbers will be typed in that Edit Text , I tried text-watcher but did not get success. Any idea? 12-26 14:59:39.715: E/AndroidRuntime(19494): FATAL EXCEPTION: main 12-26 14:59:39.715: E/AndroidRuntime(19494): java.lang.StackOverflowError 12-26 14:59:39.715: E/AndroidRuntime(19494): at android.view.ViewGroup.findViewTraversal(ViewGroup.java:2765) 12-26 14:59:39.715: E/AndroidRuntime(19494): at android.view.View