Questions tagged [android-textwatcher]

For questions related with TextWatcher callback interface

A special interface, that allows watching of the Editable field contents.

Has three callback methods:

  • void afterTextChanged (Editable s)
    This method is called to notify you that, somewhere within s, the text has been changed.
  • void beforeTextChanged (CharSequence s, int start, int count, int after)
    This method is called to notify you that, within s, the count characters beginning at start are about to be replaced by new text with length after. It is an error to attempt to make changes to s from this callback.
  • void onTextChanged (CharSequence s, int start, int before, int count)
    This method is called to notify you that, within s, the count characters beginning at start have just replaced old text that had length before. It is an error to attempt to make changes to s from this callback.

Useful links

205 questions
1
vote
0 answers

Autocomplete TextView doesnot show suggestions in Textwatcher

I m implementing a feature like WhatsApp group activity. I created an arrayadapter to set in textwatcher in the autocomplete text view. Whenever I press "@" according to my logic the dropdown menu opens but whenever I press any other key, dropdown…
1
vote
1 answer

Can I use The same TextWatcher on different EditText widgets

I have a form. I want to display a calculation in "live time" when the user enters different values into some int fields. I made my Activity implement the TextWatcher interface and set a listener on 3 different EditText fields but it appears the…
user5510527
1
vote
1 answer

Notify CursorLoader while TextView in Toolbar changed

I have a TextView in my Toolbar and this TextView display a selected Date (e.g. Saturday, 7. October 2017). This Toolbar is in my MainActivity and inside this MainActivity i have a Fragment with a ListView. This ListView is linked to my…
Neal Mc Beal
  • 245
  • 3
  • 16
1
vote
1 answer

Add Dynamic table rows to table layout in android together with textwatcher

I try to Add new Table rows into TableLayout in my android app. I successfully added new table rows with multiple edittexts, by following an android tutorial. Now what I try to do is, I need to get user values for those edittexts using TextWatcher.…
1
vote
2 answers

Using Android TextWatcher with multiple user input values and Update thses values

I am very new too Android. I try to develop an android application to get the total amount of user input items. Here is a sketch of my application.enter image description here User Must enter First Row Col1 and Col 2. But First Row Col3 can enter or…
Lash
  • 53
  • 7
1
vote
0 answers

How to fix InputMethodManager Leaks in android?

I keep seeing InputMethodManager leaks coming from android view in my login fragment in android. I am using leakcanary to detect these. Has anyone faced these issues before and knows how to fix it? Here's my leak info: In…
user2386226
1
vote
2 answers

How to change TextView if there's input in multiple EditTexts?

I'm trying to wrote android program which displays Greatest Common Divisor of two integers specified in two different EditText fields. First I've done it with button, everything worked (you can see onclick listener commented out in code below). Now…
Vykintazo
  • 163
  • 2
  • 11
1
vote
2 answers

How can i make my button become visible with TextChanger?

I made a button invisble in xml, I want to make button visible again when a certain string value in my EditText is made. I have used TextWatcher check when the value is met using an if statement. However when the code to reveal the button is…
1
vote
2 answers

TextWatcher warnings and slow type in android

I want to change on type a character in android. If user type space or - it will change it to _ So I tried: TextWatcher tt = null; final EditText etUsername = (EditText) findViewById(R.id.etUsername); tt = new TextWatcher() { public…
RGS
  • 4,062
  • 4
  • 31
  • 67
1
vote
3 answers

Unable to add decimal with EditText inputType="number" Android

The dot or comma button is disabled when inputType="number" or inputType="number|Decimal" is pressed. It failed to work with android:digits="0123456789.," also. The EditText contains a textwatcher which format the number. The textwather is as…
1
vote
1 answer

Trouble with Fragment TextWatcher to Activity communication

Having problems getting Fragment to Activity communication working properly.. I have an edit box in a Fragment and I need it to send its value back to the main activity after each edit. Fragment Class: public class FragA extends Fragment { …
Adrian M
  • 325
  • 2
  • 12
1
vote
5 answers

Working with TextWatcher and ListView

I have a String[] called lv_arr, and my activity looks like this: It contains a EditText and below that I am displaying a above lv_arr[] using this code: listView = (ListView) findViewById(R.id.listview); ArrayAdapter adapter = new…
varsha valanju
  • 801
  • 1
  • 9
  • 27
1
vote
2 answers

Android Activity freezes when search from database

I have a textWatcher for my editText. The idea is: I have two list views and they are both updated after every inserted in editText field character. Somehow I could't implement this using standart ArrayAdapter with filter method. So I had to make my…
1
vote
1 answer

TextWatcher implementation with RadioButtons

Please see attached image and code snippet to aid in explanation. From the attached image I would like the user to enter a cost, quantity and select either Include Tax or Exclude tax and a new cost is automatically generated where indicated without…
1
vote
0 answers

TextWatcher that changes two ListViews with two custom ArrayAdapters

I have the code for TextWatcher that changes 2 different listViews using 2 different ArrayAdapters. private TextWatcher createAndReturnTextWatcher() { final List list = dbExtractor.getDataForSearchAdapters(); adapterForSearch = new…