Questions tagged [android-edittext]
The EditText is the standard text entry widget in Android apps. If the user needs to enter text into an app, this is the primary way for them to do that.
11,974
questions
0
votes
0
answers
19
views
Cursor not moving after adding click tracking on endDrawable
I add onTouch tracking for EditText. Here my code:
editPassword.setOnTouchListener(
View.OnTouchListener { view, event ->
when (event.action) {
MotionEvent.ACTION_DOWN -> ...
-1
votes
0
answers
20
views
add a comma in amount using android studio
I would like to have an edit text that would automatically input a dollar sign before the number and add an automatic comma after 3 numbers
The idea is to allow currency amounts to be entered while ...
0
votes
0
answers
20
views
how to return to the original backgroundtint colour for edittext
Hi I have an edit text and I want to change the backgroundtint to the original color.
this way I am changing to the red colour but want to return to the original colour, how can I do that please
...
0
votes
0
answers
10
views
When manually drawing in OnDraw in an Android Edittext, the drawing doesn't scroll with the Text. How can this be fixed?
I'd like to create an Android EditText with line numbers as per this post:
How to show line number in EditText
The code works, but when the text scrolls, the numbers don't scroll with it.
How can I ...
0
votes
2
answers
28
views
Barcode Scanner - (Data Wedge) TC26 device reads data twice in EditText
I am working on a barcode scanner using DataWedge API's for TC26 device. I can see sometimes the value in EditTextBox the value is shown twice randomly. For example : value 123 is scanned but in ...
0
votes
1
answer
10
views
Animation yoyo keep run when typing Edittext
when typing edit text yoyo animation keep run how to keep typing show animation Once ?
text_send.addTextChangedListener(new TextWatcher() {
@Override
public void ...
0
votes
0
answers
9
views
Hashtag Suggestions inside edittext - Android Kotlin/Java
Expected :
I have to do like Social Media #Hashtag suggestions Inside Edit text , when user enter "#",I will show popup and once selected need to enter the value in edittext.
To Achieve ...
0
votes
0
answers
15
views
How to detect down arrow on keypad [duplicate]
how can I detect the down arrow on the keypad.
I have an edit text, when it is clicked i open a number keypad, I want to detect when the keyboard is closed by clicking on the down arrow as shown in ...
0
votes
0
answers
13
views
how to display editText value with emoji in ui in android?
I m not able to display value with emoji in ui in android when i do set text if the value contains with emoji the value is getting disappeared in ui .
Below is the code for edit text
<EditText
...
0
votes
0
answers
23
views
How to implement Scrolling hint like Instagram that is use to show text in search bar on android
I want to implement auto scrolling text as a hint in my search bar like Instagram use to show. I have no clue or idea how to implement this feature.
I have attached a gif image that will show what I ...
0
votes
0
answers
17
views
focus on empty line in middle of multiline edittext android
I am trying to make users put their text from the line they select even if it is away from other lines in edittext.
edittext is a multiline type so is there a method or event in touch events that ...
0
votes
1
answer
23
views
send id number from recyclerview to another activity
I have an activity that contains a RecyclerView and a button that open another activity with some EditTexts that insert the data to google sheet and I read all the data of it in the RecyclerView, I ...
0
votes
0
answers
19
views
How to use SearchView with fragment
I am using a RecyclerView and on the top of the RecyclerView I am using a SearchView but the SearchView is not focusable. I have tried with EditText too, but the EditText is also not focusable.
Can't ...
0
votes
0
answers
21
views
How to store/update values from EditText to a JSON file (Data.json) in Server or Google Drive in Android?
The following is my MainActivity
public class MainActivity extends AppCompatActivity {
private static EditText name, location, age, number;
private static TextView showJsonData;
@Override
protected ...
0
votes
0
answers
13
views
how disable function: double space converting to point(dot) in EditText Java AndroidStudio
when type space two times in the row it automatically converting(replacing) to dot(". ").
I want to disable this function only in my EditText
0
votes
1
answer
34
views
EditText not showing the hint or the outline box until focused
I saw that there are numerous threads raised on this topic but none of them seems to solve my issue.
I have an EditText inside of InputLayout and it shows blank until focused.
<com.google.android....
0
votes
2
answers
40
views
set length character Emoji Edittext Android Kotlin
i have 1 edittext maxLength = 30, but i can only type 6 character emoji dog => 1 emoji dog = 6 regular character. So please help me type 30 emoji dog. Thanks everyone.
[enter image description here]...
0
votes
0
answers
22
views
TextWatcher class trims space from end when spacebar is pressed and cursor moves to beginning of editText
Below is my textWatcher class:
class MyTextWatcher(private val editText: EditText) : TextWatcher {
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
...
1
vote
1
answer
25
views
How to add `Done` and `Cancel` imei option on android keyboard for edit text
not sure if this is possible,
I have an edit text and when it is clicked a number keypad opens and I want to add actionSend which will make an api call to send the value in the edit text.
If the user ...
0
votes
0
answers
35
views
Getting unwanted line breaks in EditText
I have this EditText that contains HTML tags... So let's say
<p dir="ltr"><span style="background-color:#585858;"><a href="someHref">Hello World</a&...
0
votes
0
answers
13
views
RichInputConnection: Unable to connect to the editor to retrieve text
I have a EditText, and I have a a TextWatcher set on it. The purpose of the TextWatcher is to edit another EditText after the first one is changed. This has been working before, but when I booted up ...
1
vote
1
answer
28
views
Predefined symbols in an EditText
I use a referral system, with codes like this : XXXX-XXXX-XXXX
How can I predefine dash in my EditText?
0
votes
0
answers
16
views
How is the state of Edit Text retained during fragment transaction?
I have a fragment(NavFrag1) with an edit text . In my activity I load the same fragment again and again using this code
supportFragmentManager.beginTransaction()
.setReorderingAllowed(...
0
votes
1
answer
26
views
How can I specify the position of editText in CardView?
<androidx.cardview.widget.CardView
app:cardCornerRadius="5dp"
app:cardElevation="8dp"
android:layout_width="370dp"
android:layout_height="450dp&...
0
votes
1
answer
36
views
Is there a way to use EditText to underline errors in the text as the user enters it?
Is there a way to use EditText to underline errors in the text as the user enters it? Or an alternative control that allows that kind of formatting?
I'm trying to process text as a user is entering it....
0
votes
1
answer
34
views
Custom drawable background for Android EditText
I would like to create a custom drawable background for an EditText component in my Android layout. This should include a lower border spanning the entire length of the EditText, and 2 connected ...
0
votes
0
answers
34
views
Detecting Backspace click on Key_Down event in Android soft keyboard
I have searched for close to 6 months and I can't get a proper code on how to detect a backspace click in an EditText view.
Using the setOnKeyListener and doing if(event.getAction() == KeyEvent....
0
votes
1
answer
35
views
How can I set the 'text' value of a TextView to be based off an EditText value or variable?
I'm currently trying to make a DnD character sheet app using Android Studio for my University Final Year Project, and I'm having some issues with creating my layout. I am currently tinkering with ...
0
votes
0
answers
34
views
How to make edittext scrollable in android kotlin?
here is XML code:-
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Description"
style="@style/Widget....
0
votes
1
answer
39
views
Get the text from an EditText created dynamically by a function
I am working on an Android application using Java. I'm using a spinner where it offers different options for a user to select and then I try to update the UI according to the selection, adding more ...
0
votes
1
answer
25
views
How to Make 2D ArrayList of EditText in Android Studio using Kotlin?
'''
class MainActivity : AppCompatActivity() {
private var button: Button? = null
private var textList: ArrayList<ArrayList<EditText>> = arrayListOf(arrayListOf())
override fun ...
0
votes
0
answers
19
views
showSoftInput() & OpenGLRenderer Davey! Android EditText Log comes whenever I click on EditText to enter something with keyboard
I have added an EditText for the user to enter a message string and I am using EditText.getText.toString.trim() in my Java code.
But, whenever I click on EditText to enter something with help of ...
0
votes
1
answer
32
views
How can you listen to soft key events sent to a View with an InputConnection?
I would like to create a custom text editor view in Android, with customizable key controls, meaning that I need to handle all software keyboard key events.
To do this, I can extend View and override ...
0
votes
1
answer
36
views
Android EditText number pad keyboard with version like filter(TextWatcher)
EditText should accept input like "1.0.1" means multiple "."s. and keyboard should be number pad(I know EditText's inputType should be numberDecimal).
But numberDecimal only ...
0
votes
1
answer
33
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 ...
0
votes
0
answers
42
views
Android: Multiple editText in recycle view. The values keeps cloning from one to another
I am creating a program for my company, where I need a part where is consignation for money. The money types are in database what I get from an api. So I use recycleView with elements. My problem is ...
0
votes
1
answer
18
views
How to disable default scroll behavior of an EditText?
The title of question might look similar to other questions but It's not. I have several strange problem that I am not being able to solve it.
I have a xml layout and the structure of that layout ...
0
votes
0
answers
53
views
clear edittext when start typing
I got some issue with my code and I can't find anything to help me. I'm trying to clear my edittext when I'm typing any char. I got this error
/AndroidRuntime: FATAL EXCEPTION: main
java.lang....
0
votes
1
answer
27
views
AutoCompleteTextView threshhold is not working as expected
I want to show dropdown list even for completely empty string. Because my coded logic in Adapter is that if filtering constraint is empty or null, show all results available. But for some reason, ...
0
votes
0
answers
74
views
If and else statement in Kotlin
Ok I have an issue with the logic of the if and else statement I am not understanding why and how the logic doesn't work. I have used the statement in other programming but this is what I am wanting ...
0
votes
0
answers
24
views
Saving the results from editText into a List in object class
I am trying to solve a problem I have been stuck on for a while. I am trying to save the results from a user submit to a list. I am able to do that but when I leave to a previous oage in the app and ...
-1
votes
1
answer
33
views
How to find Edittext by id in a dialog?
I have a Dialog with an EditText, there, it asks for a wallet, and users write it.
After that, this wallet should be stored in a String, but it says that it's null.
Attempt to invoke virtual method '...
0
votes
0
answers
5
views
Load Image or video view when pasting url in editText like WhatsApp
Please guys, am trying to achieve something like this in my firebase chat app but don't know how to do it Load Image on web url paste in editText layout
-1
votes
1
answer
52
views
how to Replace urls by 4 count in editext if detected
i want to have edittext of 300 char limit but i have a requirement that if detected urls in edittext then it should replace the count by 4 keeping the urls as such
for example :--
If i paste
https://...
1
vote
1
answer
40
views
java.lang.ClassCastException: android.text.SpannableStringBuilder cannot be cast to com.ree.kms.DakaHinbanClass
I want to add EditText to the listview, but I can't do it smoothly. Please guide. If it is List<String>, it is normal, but DakaHinbanClass is used, How to write code that uses Class
The data is ...
0
votes
0
answers
36
views
update recyclerview item value on Text change of other item value entered
I have a recyclerview where view type is edittext and on value entered of the edittext, other edittext values should be added with current value.
value entered in edittext item 1 of recyclerview and ...
1
vote
1
answer
51
views
How to make EditText act like a spinner in Jetpack compose [duplicate]
I'm trying to get an EditText view to show a spinner when clicked then display the selection or at least something like the underlined spinner but with a leading and trailing icon.
PS: The EditText ...
1
vote
1
answer
18
views
Can't focus on EditText after setting focus to true
Im having trouble undestanding what is happening here.
If I don't mess with "setFocusable" on EditText it works like I excpect (when you click on it the keyboard pops up and you can edit it ...
0
votes
0
answers
4
views
What is the Default Value of EditText only Number in Android
I am going to make a condition on EditText view. but i need to declear something either it will work or not. so i want the default value of >EditText.
Thanks.
0
votes
0
answers
17
views
EditText not editable after ListView is put into LinearLayout
I'm building a simple To-Do app.
I've put EditText and then created LinearLayout above. But after I put ListView into LinearLayout, EditText stops working meaning that I can't press on the plain text ...