<RelativeLayout android:id="@+id/LinearLayoutAR"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<ListView android:id="@+id/ARListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></ListView>
<ProgressBar android:id="@+id/arProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"></ProgressBar>
<!-- Here is the view to show if the list is emtpy -->
<TextView android:id="@id/android:empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="No Results" />
</RelativeLayout>
There are several reasons for showing an empty view as a text view. The problem is that this text view always comes out. Even if the list view is not empty. I thought it would automatically detect if the list view was empty, but it wasn't.
android listview relativelayout
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="No Results" />
Just do it like this. The problem is android:id="@android:id/empty" this part.
© 2024 OneMinuteCode. All rights reserved.