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 trialNoam Elbaz
5,672 PointsEmpty Text View (Blog Reader - Stage 4 - Adapting Data for Display in a list)
I'm on Android Studio: A few minutes in to the video, Ben switched a textView into an empty text view, which we will be referencing in code with the line: TextView emptyTextView = (TextView) getListView().getEmptyView();
i did not see any easy option to switch the textView to an Empty text view in android studio and setting the text in the XML to = "" did not seem to work.
Stuck.
.... and yes i did google it.
Thanks
3 Answers
kylan hill
3,125 PointsDid you set the id of the TextView to empty in the xml file?
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
Noam Elbaz
5,672 Pointskylan hill - that's all he meant? to change the id to empty?
thanks.
kylan hill
3,125 PointsYes, np best of luck
Roman Kozak
3,119 PointsWorked for me, thanks!