Dexto
Dexto

Reputation: 1201

ListView tools:listitem not working in android studio 2.2 stable channel

Steps to Reproduce:

What should happen:

It should use the layout from tools:listitem to render list items.

Actual result:

Nothing changes, it still shows the default list with generic views

Bug Report

I could see this bug was already filed on Jul 5, 2016 Bug Report Link

Are there any work around available to render list?

Upvotes: 15

Views: 2940

Answers (5)

Radosław Panuszewski
Radosław Panuszewski

Reputation: 536

One thing to notice: it's tools:listitem not tools:listItem which is somewhat confusing. Took me some time to figure that out, since Android Studio currently doesn't provide autocompletion for that.

Upvotes: 7

Ibramazin
Ibramazin

Reputation: 1018

File -> Invalidate Caches and Restart

fixed the issue for me

Upvotes: 0

Cristan
Cristan

Reputation: 14135

Another reason why tools:listItem doesn't work is when you're using the AndroidX's RecyclerView when using an older Android Studio. Update to 3.2 or higher and it will work.

Upvotes: 1

Nagaraj Wadakannavar
Nagaraj Wadakannavar

Reputation: 67

You must define an id i.e. android:id="@+id/list_view" to your list

Upvotes: 2

Cristan
Cristan

Reputation: 14135

This is fixed in Android Studio 2.3 beta 1

Upvotes: 0

Related Questions