2

When creating both TextView and Buttons, when a resource is set to be the text

tools:text="@string/testString"

it will show on the design view for the XML, however when running the app, the buttons or texts show the values from the hardcoded text, or appear blank if they don't exist.

android:text="Something else"

The strings.xml resource is readable however, as changing the name of the app for the title view works.

This happens on EVERY Android activity so far, even in brand new projects. I have tried uninstalling and reinstalling the studio, all the APKs.

1 Answer 1

1

tools name prefix only works as the name imply in the android studio layout designer and has no effect on the app.

so you should use android:text="@string/testString"

Sign up to request clarification or add additional context in comments.

2 Comments

I've literally just found this by trial and error. Thank you. Turns out I was trying to use them the wrong way round. Thank you.
Great, in my case it was zeplin generated code. It uses tools:text instead of android:text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.