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 Android Data Persistence Introduction to Data Persistence Using EditText Data

2,973 Points

What's wrong with this?: textHolder.setText(entryField.getText());

Why is this wrong? And what's the right answer?

EditText entryField = (EditText)findViewById(R.id.entry_field);
TextView textHolder = (TextView)findViewById(R.id.text_holder);

1 Answer

2,973 Points

Ok, I found the answer in the other answers. I needed to add the toString().

I understand this may be a basic command but some of us took that previous course months ago and have written many lines of code without needing to set a textview equal to an edittext.

My suggestion: A little hint would have been nice.