Skip to content
Advertisement

Tag: android-edittext

Need help outputting “You must enter a name” when nameText is null. With the code I currently have it doesn’t recognize when the nameText is empty

MainActivity Need help setting the text to “You must enter a name” when the nameText is null. For some reason even when the nameText field is empty it still outputs “Hello” when it should be outputting “You must enter a name”. Answer Probably you need to check if the text of your EditText is null, not the EditText widget itself.

editText.getText().toString() can’t enter data

I am trying to make an app in which I can add subjects and my grades, currently, I am working on a system for adding subjects. So, I have a button, when pressed it makes an editText “field” in which you can enter the name for the subject. The problem is, when you enter some text and press ENTER, it

Android: crashed when EditText Material is empty [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question Iam trying to put the code here but the site keep giving me error So here is it https://github.com/C9nc/Empty-EditText/blob/main/EditTextCheck Answer You have initialised the buttons and

Disable text wrapping in Android

I’m working on a project in Android where I have a TextView (an EditText to be exact) and a setting to enable or disable text wrapping for that view. I have searched the internet (a lot) but still haven’t found any satisfying solution. Currently I’m using a NestedScrollView for the vertical scrolling and then dynamically insert one of two partial

Capitalize every word in Edit text while typing

I want to capitilze every word in edit text while typing. My XML:- Now I am using But problem is it is not working in some device. Ex LG tablet. So I decided to do this programatically. So I am using following codes. Here my app getting crash. I found the problem while debugging. Problem is the onTextChanged is not

Advertisement