Questions tagged [addtextchangedlistener]

63 questions
4
votes
2 answers

AutoCompleteTextview with Textwatcher android

I have a small issue with AutoCompleteTextview with textwatcher. I Have AutoCompleteTextview for Suggestion.The data Comes From API side. With every new word I write in, API is being called and, it gets Response from ApI side and then, The show…
RushDroid
  • 1,456
  • 3
  • 15
  • 38
4
votes
3 answers

Append text at beginning of edittext

How to automatically add a text at beginning of edittext as soon as user start typing in it.For example I want to automatically append country code as soon as user start typing phone number. I tried- mNumber.addTextChangedListener(new…
Android Developer
  • 7,267
  • 16
  • 62
  • 113
3
votes
1 answer

Dynamic View with add button, how to find unique edtxt ID or anything else

I am building an android application where I am creating dynamic EditText View. I need to display the sum of all EditText on the top TextView. I am unable to find a way to do that, Can anyone help me with this. And I am also not understanding, when…
Rajiv Reddy
  • 411
  • 3
  • 15
3
votes
2 answers

Custom phone number format (XXX-XXX-XXXX) TextWatcher getting stuck

Things is Working: The format (XXX-XXX-XXXX) which I want in phone number EditText is worked. Problem is: While deleting character "-" ,It can't deleted. I am getting stuck. PhoneNumberTextWatcher.java import android.text.Editable; import…
pRaNaY
  • 21,330
  • 22
  • 85
  • 134
2
votes
3 answers

How to use spannable strings in addTextChangedListener to change color of editText substring?

I am trying to implement something similar to a code editor where keywords are automatically highlighted. I am going to have a string array and I want to change the color and font of the editText string when the user types the text and it matches a…
2
votes
1 answer

How to add onTextChanged listener to an include layout xml by databinding in android

I have an issue to add onTextChanged to a TextInputEditText in an include layout. There is a base_edittext_view.xml as below:
2
votes
2 answers

RecyclerView shows previous values entered in an EditText in new rows

I'm creating an android app, in which I'm using recyclerView and the row of recyclerView is having editText. This is my ReadingAdapter class public class ReadingAdapter extends RecyclerView.Adapter implements…
Shambhu
  • 171
  • 4
  • 16
2
votes
2 answers

Android two TextInputEditText and two way addTextChangedListener

I have two TextInputEditText fields: TextInputEditText fromData = (TextInputEditText) view.findViewById(R.id.fromData); TextInputEditText toData = (TextInputEditText) view.findViewById(R.id.toData ); Both fields has addTextChangedListener() and…
Sever
  • 1,531
  • 3
  • 26
  • 48
2
votes
2 answers

Search item in edittext from listview showing wrong result

Trying to search a listview items using edittext, where clicking on searched item returning wrong position. Supposed i search "C" from given list where list item is as follows "A","B","C","D","CC", and got the correct search result but once making…
1
vote
3 answers

Android - RecyclerView - edittext notifyItemChanged keep focus and continue typing

I have a RecyclerView which has an EditText in its items. For each EditText I have added a textChangeListener. Whenever the user types a character I want to do an input validation and so I can change the item, for example show red border in case of…
1
vote
1 answer

Sum up all decimal value in programmatically created edit text

Please help, I want to create 30 edit text and get the sum of them. Currently, I am able to get the sum however this only work for whole number. when I enter decimal value the sum is not accurate. And the program crash when I delete the value in any…
1
vote
2 answers

Format a number string into 2 decimal double independent of the number string length

In Android application developed using Kotlin, there have an EditText which accepts number only which is considered as USD. The input needs to be formatted into 2 decimals so that the input needs to be formatted as below 7 -> 0.07 73 -> …
1
vote
0 answers

Android Studio: How to make an EditText in a listview retain the changed value?

I am making a listView and in each item, there is a TextView identifying the field, and an EditText for the user to fill out the value. When I input the text into the EditText, the text just reverts back to what it was before. How do I make it so…
1
vote
1 answer

RecyclerView .addTextChangedListener gives multiple positions

I'm trying to create a RecyclerView that contains an EditText in each row. Once the text is changed i'd like it to show the position with println. It runs fine until i run .notifyDataSetChanged() in my main method. After that it prints multiple…
1
vote
4 answers

Elegant way to enable/disable button depending on input in two or more EditText fields

I have read this question How to disable Button if EditText is empty ? But there it is only 1 EditText field. What is an elegant solution to use a TextWatcher to enable or disable a Button if both of two EditText fields are either empty or contain…
1
2 3 4 5