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 trial

Android Build an Interactive Story App (Retired) User Input Getting Text from an EditText

Converting name to string

So you asked how we would solve the problem of converting the editable text into a string during the video.

So here is my question. Is there a difference in using the the following code:

String name = mFieldName.getText().toString();

compared to doing

String name = mFieldName.getText() + "";

1 Answer

Short answer NO. Long answer YES. Practicle answer? The result is the same.

You have to love programming where there is always multiple ways of doing things.