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 trialchannonhall
12,247 PointsI need help! Challenge : Change the ID for this ListView to the Android ID for a list. Remember that Android system IDs
Change the ID for this ListView to the Android ID for a list. Remember that Android system IDs start with @android:id/. Challenge Task 2 of 2
Please help me!
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ListView
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</ListView>
</RelativeLayout>
2 Answers
Unsubscribed User
7,176 PointsHey Channon,
So the instructions want you to change the ID of the ListView. So when you have at the ListView element you realize that the first attribute sets the ID and that where you have to change the ID.
Here is how it should look like:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</ListView>
</RelativeLayout>
I hope that was helpful, Patrick :-)
channonhall
12,247 PointsThanks a lot!!!1!!1!! Can you please help me with this other challenge
Thanks Pat! : D
TERRENCE MAVHUNGA
6,053 Points<ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" > </ListView>
channonhall
12,247 PointsThanks man, Patrick already helped me on this challenge I still appreciate the help thoe
TERRENCE MAVHUNGA
6,053 PointsTERRENCE MAVHUNGA
6,053 Pointsandroid:id="@android:id/list"