android-edittext

How can I limit the EditText box input to two characters after a decimal place?

跟風遠走 提交于 2019-12-14 02:06:42
问题 i'm working on an android application with an EditText box. In this box i want the user to enter currency. I have already restricted the keyboard to numbers and decimals using the handy android:inputType="numberDecimal" but i would like to be able to stop the user from entering more than two digits after the decimal place (so that the content is saved as a currency and also just because i think it's important that the user is clear about what they're entering). However i don't have much

Monodroid - EditText input method won't accept numbers

别说谁变了你拦得住时间么 提交于 2019-12-14 01:40:27
问题 I am having some very strange problems with the EditText control in Mono for Android. My solution is targeting 2.3 and I am debugging on a T Mobile VivaCity. Here is my AXML for the EditText <EditText android:inputType="text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/ctl_searchText" /> When I show the View containing the EditText the keyboard automatically appears, this is not a problem. The problem is I can't enter any numbers by tapping the

Auto Search in Android app while fetching data from external server

五迷三道 提交于 2019-12-14 00:24:48
问题 Hi Guys, I want a similar searching functionality like Twitter,etc apps. User will enter text and as per the text entered, user should get the updated set of options to choose from. I am fetching data from external database for that. Currently I used a web-service and passed the data to be searched in it, which gives me relevant results. I am calling that web service on onTextChanged event of EditText . But this causes me to fire that web-service every time a letter has been added. Can

Android RecyclerView Edittext issue

ぃ、小莉子 提交于 2019-12-14 00:19:30
问题 I'm creating a list of editable items (received from backend). I'm using the "new" recyclerview for this. There a couple of possible viewTypes in my recyclerview: checkbox spinner edittext The problem I'm having is with the EditText gaining focus. AdjustResize kicks in fine and my keyboard is shown. But the EditText that has gained focus isn't visible anymore in the list. (position in the list in the now resized portion is below the visible positions). I don't want to be using AdjustPan in

Dynamically add a Edit text

梦想的初衷 提交于 2019-12-14 00:02:39
问题 I want to add an edit text field to my app when i click a button, but i do not change the layout. Just add it below an existing one defined by the xml file. Lets say i have a contacts app and if the user needs to add an extra field hit the button and creates one! How to do that? 回答1: What you can do is have those EditText's in a panel, i.e. group them in panels, then have a button, and on button click create an instance of an EditText and add it to the relevant panel. This way you are not

How to change background of TextView From EditText Text Change?

此生再无相见时 提交于 2019-12-13 23:09:43
问题 I am using Fragment class in which I want to change the color of Text View When text is changed on my edit Text. What are the possible ways to change the background color of TextView When Text is Changed in EditText . My code looks like this : public class Fragment_AboutUs extends android.app.Fragment { TextView about_btn_call_customer; TextView about_btn_Submit; EditText about_feedback; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState

How to put a border in an EditText? [duplicate]

拥有回忆 提交于 2019-12-13 23:04:11
问题 This question already has answers here : How to have EditText with border in Android Lollipop (5 answers) Closed last year . anybody could tell me, how to put a border in an editText in AndroidStudio? for example a square in an editText. 回答1: just try this one, first create one XML file, inside drawable folder (use new drawable xml) and add this lines <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"/> <solid

show EditText on condition

↘锁芯ラ 提交于 2019-12-13 23:03:03
问题 Right now I have an idea for a project and I would like to know if anyone can help me on the same logic. As such I need to create or generate a number of EditText according to amount you enter, ie, to select or enter a number such as 5, show me 5 EditText layout for type 5 values​​. They know that the form could accomplish this? Any ideas please? I guess it must be a way to do it with a loop, but not like carrying this calculation Java to XML. Thank you. 回答1: Here is an example of generating

How to disable the SwiftKey (third-party keyboard) behavior in EditText?

China☆狼群 提交于 2019-12-13 18:12:55
问题 I'm using the standard EditText control in my Android app. The input for this EditText should be inserted only from the built-in Keypad of the app. When SwiftKey (third-party keyboard app) is installed on the device, it causing to strange behavior like a jumpy cursor, and underline below some text. My question is, how can I avoid of any third-party keyboard effects in the EditText control. 回答1: My question is, how can I avoid of any third-party keyboard effects in the EditText control. You

How to store edit text data from an Android dialog?

半城伤御伤魂 提交于 2019-12-13 16:18:45
问题 I've set up an alert dialog with multiple edit texts but I'm not sure how to store the values being entered in the alert dialog. Usually I could just do something along the lines of this: final EditText input = new EditText(this); alert.setView(input); Editable value = input.getText(); But my MessageDialog is a separate class being called from SearchResult.java like this, so I don't know how to access instances of the edit texts in the MyMessageDialog.java: MyMessageDialog.displayMessage