Skip to content
Advertisement

Tag: textview

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.

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

TextView setContentDescription not working

I’m trying to set the contentDescription on a TextView but it doesn’t seem to be announced by TalkBack. TalkBack is only vocalizing the text content. The second line above has no effect. TalkBack says, “2d 9h left”. I’ve also tried the following: but this results in TalkBack announcing “2days 9hours left 2d 9h left”, which is also incorrect. Answer The

Advertisement