Questions tagged [textwatcher]

TextWatcher is an interface in the Android SDK that can be attached to an Editable object to see when that Editable's text changes.

The android.text.TextWatcher Java interface is implemented by objects attached to an widget on . It exposes three methods, each of this methods will be called at a certain moment of the text being modified (for example: after the text is changed). Care must be taken when using the TextWatcher's methods to avoid getting into an infinite loop or to incorrectly modify the text.

625 questions
-2
votes
1 answer

NullPointerError when using TextWatcher

I am currently trying to use TextWatcher for my application. However, I have found difficulty in removing a certain NullPointerError, happening whenever I launch activity in concern. I've tried to use stacktrace, but I couldn't fix it. Can you…
-2
votes
2 answers

How to determine if someone is typing on editText

I am designing a chat application using android studio and i am using fire-base as cloud service provider and i got stock on how to make a listener like if the user is typing on the edit-text field The value of the user on fire-base will changed…
-2
votes
2 answers

EditText Removing Currency Symbol in TextWatcher not working

I want to remove the dollar sign to my amount formatter but its not working I already assigned the replace it it contains an dollar sign. How can I do this? Here is my code for Text Watcher. NumberFormat canadaEnglish =…
Robit
  • 11
  • 1
  • 6
-2
votes
1 answer

Getting last typed word in a string variable in Android

I need to get the typed words from textbox for further use. So i am using the TextWatcher and at onTextChanged event i am getting the edittext box Content. It gives the full content of the text box. But i need the typed word not the full content…
binu j
  • 399
  • 1
  • 3
  • 18
-2
votes
2 answers

First charector of EditText should be alphabet

In my EditText I want to enter the first character as alpha and the remaining is whatever. I achieved this task with the help of TextWatcher. But now my problem is if I entered something wrong(like digits, special characters) as my First character…
Gunaseelan
  • 14,415
  • 11
  • 80
  • 128
-2
votes
2 answers

replace typed character in Android's TextWatcher

i want to replace typed character with "a" charcter in Android's TextWatcher but save real typed character inside a variable too. to do this, in afterTextChanged i write this code to replace character: if(s.toString().charAt(s.length()-1) != 'a'){ …
Fcoder
  • 9,066
  • 17
  • 63
  • 100
-3
votes
1 answer

Application crash at runtime

This will be my second question along these lines as the previous post seems to have pretty much stopped drawing attention, so sorry for the spam. Anyways, last time I posted because I was getting a runtime crash as well as various errors within my…
GidKort
  • 1
  • 1
-5
votes
1 answer

I need to make a simple TextWatcher calculator if it's possible

I want to create an app that only contain 3 EditText. (Nothing else) EditText1 EditText2 EditText3 now 1) If I enter values for EditText1 and EditText2 then addition should be performed between ET1 and ET2 then answer should be set to…
-6
votes
2 answers

Define a value to EditText

I'm trying to make an Activity with an EditText that can only accept a value that I defined programatically in advanced -kind off like a password, like a word or a code number- so that the user can't access the next Activity if he dosen't enter the…
-6
votes
2 answers

Last character taken twice by textwatcher

I am trying to implement a simple Rich Text editor. The code works fine for alphabets and numbers but the last character typed before I press space/enter/delete is repeated (appended) before the space or enter is appended. example :if i type (hello…
sisir
  • 111
  • 2
  • 13
1 2 3
41
42