Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing @string with empty "" textView android xml

new dev here and hoping someone can help me, i have looked and cannot seem to find an answer to my question, i have all my textviews @strings but i am wondering, i have a textview that has an empty value in my xml on android studio i.e android:text="", i have to leave this empty as this is to display a results from a string array.

So my question is how can i add this to @string values when it is empty? sorry for the noobish question but i have not been able to find the answer to my question!

thank you

like image 259
mard dean Avatar asked Nov 29 '22 01:11

mard dean


2 Answers

A shorter version that does not generate a lint warning for the empty body of the xml tag:

<string name="empty" />
like image 166
Nantoka Avatar answered Dec 06 '22 09:12

Nantoka


Simply define a string like

<string name="empty"></string>

in your strings.xml file

like image 33
Phantômaxx Avatar answered Dec 06 '22 10:12

Phantômaxx