209 questions
0
votes
0
answers
43
views
EditText in RecyclerView only allows one character input at a time
The EditText input is limited correctly to 7 characters using InputFilter.LengthFilter(7), and that part works as expected.
However, I'm having a strange issue: when I type into the EditText inside a ...
0
votes
1
answer
118
views
How to use dots and comma to seperate numbers in kotlin
I'm trying to implement a text watcher with comma and dots but i couldn't find a solution. Here is what im trying to do if user input 10000 i need to show this in my edittext as 10.000 and if user ...
0
votes
1
answer
49
views
Exception in TextWatcher Kotlin - java.lang.NumberFormatException: For input string: "interface kotlin.jvm.functions.Function0"
I have implemented a TextWatcher for my EditText
txt_height!!.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: ...
0
votes
0
answers
55
views
Prevent user from pasting more than x characters in EditText but allowing them to type as many characters as they want
I know that limiting the text length of EditText can be done using the maxLength attribute in xml or using InputFilter using the below approaches
Using xml
android:maxLength="10"
Using ...
1
vote
1
answer
610
views
Android-RecyclerView get text and set text in the same row
I am loading editText on click of fab button in recyclerview. I want to setText on TextView in the same row of recyclerview entered in editText. Currently the text is setting from 2nd textview and ...
0
votes
1
answer
72
views
How to disable one edittext when we start typing other editext in android?
I have a form with two editext and condition is only one should be enable when we enter value to any of edittext e.g
We have 2 edittexts ...Edittext1 and Editext2
case 1: When we type edittext1 then ...
0
votes
1
answer
536
views
Get data from list of EditTexts in a recycler view to a list?
I am having an EditText in a TTextInputLayout as a Row_item for my recycler view, On the click of a button I am incrementing the count value in that recycler view and adding the edit text views in the ...
1
vote
2
answers
1k
views
(Android) Unable to show dot as thousand separator in edit text using a pattern
Here, I have to show currency decimal separator and thousands separators as per the given input like:
private var decimalSeparator: Char = '.'
private var thousandSeparator: String = ",&...
3
votes
1
answer
81
views
Inconsistent onTextChanged() behaviour
I wrote the code below to figure out how onTextChanged() method works:
override fun onTextChanged(string: CharSequence?, start: Int, before: Int, count: Int) {
Log.d(TAG, "...
-2
votes
1
answer
163
views
Prevent user to add text after 10 commas entered in edittext
I have to create a comma-separated array. So after 10 comma edittext should not accept the text or latter enter by user <- I have to do this. Here's the code I am using. but it goes to infinite ...
2
votes
1
answer
54
views
2 TextWatchers for 1 EditText
I'm working on a simple android app project for myself. I found an article that made me decided to use TextWatcher. So simply, I add TextWatcher into my code. But here's the thing. I have designed 2 ...
4
votes
3
answers
1k
views
How to fill edittext with placeholders until it is not filled
I faced the following problem: I need to implement the solution for the case when the phone should be entered to the EditText. This phone should have non-removable part and last four numbers should be ...
0
votes
1
answer
58
views
Make few prefilled characters uneditable in EditText using Android
I am working on EditText where I am displaying pre filled country code in start lets say "+971", what I want is that if user trying to click and edit in EditText, he should not edit or ...
2
votes
0
answers
186
views
afterTextChanged() event callback of TextWatcher gets invoked even when the user does not tap on the EditText field [duplicate]
I have an EditText field in my application and have a TextWatcher associated with it. The afterTextChanged() event callback gets invoked even when the user does not tap on the EditText to edit it. I ...
1
vote
1
answer
263
views
Is there any need to remove TextWatcher when dialog is dismissed in android?
I want to listen to TextView text changes in my dialog, So
I am using TextWatcher like below:
final View layout = activity.getLayoutInflater().inflate(R.layout.popup_history,
...
0
votes
4
answers
1k
views
How do you change an EditText on Android based on specific values inputted?
I want the user to change some device settings, for example run an alarm after X seconds (default 5s). I want the user to be able to type in what they want (number value from the edit text), but if ...
0
votes
2
answers
161
views
How to make a formated EditText start from Right to Left using TextWatcher?
What I have:
I have an EditText which accepts decimal input and I setted the default value in the XML to 0.00 (if there is no input yet)
If the user press 1, then the value change to 1. If he needs to ...
0
votes
1
answer
40
views
Developing an app with 100's of EditFields and TextFields
I am developing an app with 100's of textfields and editfields. In a lot of them I have used textwatcher to listen to changes and update other textfields. I dont have much choice on this matter as a ...
1
vote
2
answers
1k
views
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 ...
1
vote
2
answers
192
views
TextWatcher -related code works well only with one EditView
I have the following issue.I'm having an activity,part of an animal shelter app, where an user has to enter or edit pet-related data like weight,name and breed.What I want to achieve is to show a ...
2
votes
1
answer
3k
views
Attempt to invoke virtual method 'void android.widget.EditText.addTextChangedListener(android.text.TextWatcher)' on a null object reference
I have spent many hours looking for a solution to this. I cannot figure out why this is a null object, and I am not sure what I am missing. If I try to make any changes to the code, it throws errors ...
1
vote
1
answer
107
views
how to keep button disable any editText Empty?
how to keep button disable any editText Empty ?
i've try with implementation 'androidx.core:core-ktx:1.1.0':
txtEmailOrNoPhone.doOnTextChanged { text, start, count, after ->
if (text....
0
votes
0
answers
131
views
Text Watcher, Erase Moves text to the left
In my App I have a few edit texts for dates
I then Have a text watcher to force the format of DD/MM/YYYY
I also have a a few lines of code to automatically enter the current date
Auto Date code
...
1
vote
0
answers
30
views
How to stop trigger 'updateCursor' event in input method?
I'am using TextWatcher and onTextChanged, but when my screen scrolled it's provoke my function in editText change.
holder.editTextCrt.addTextChangedListener(new TextWatcher() {
boolean mToggle = ...
1
vote
0
answers
242
views
How to format Phone Number from PhoneNumberFormattingTextWatcher through local?
I am using Phone Number Formatting TextWatcher to format number according to given locale. my App support multiple language and i want to format phone number according to user selection like Uber app ...