Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSlava Fleer
6,086 PointsWhy we need to use for tools:text instead android:text in this project?
I understand the difference between this tools but if we have any advantage here? Cause our adapters changing this text anyway, so why bather about it when we are creating layout for items ?
Thanks.
1 Answer
George Pirchalaishvili
3,747 PointsWhen you use android:text - it will set default text of the field which you will be able to see in preview and emulator When you use tools:text - you will see this default text only in preview and not in emulator.
Since there is a chance you wont get any data from server (Json data) and you will not have anything to display in the field, you want that field to stay blank rather than with default text.
Does this make sense? :)
Slava Fleer
6,086 PointsSlava Fleer
6,086 Pointsprobably =)
George Pirchalaishvili
3,747 PointsGeorge Pirchalaishvili
3,747 PointsWell if you have other questions - feel free to ask ;)
Slava Fleer
6,086 PointsSlava Fleer
6,086 Pointsthanks. I would =)