当应用程序启动时,我从main.xml文件显示一个进度条,直到列表为空。一旦列表填充了来自URL的数据,我应该关闭此进度条。 如何在不使用进度对话框的情况下做到这一点?Android - 自动关闭进度条
我的main.xml
<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/list_view_places"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true" >
</ListView>
<ProgressBar
android:id="@+id/empty_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
看看这个链接http://stackoverflow.com/questions/3771568/how-to-show-empty-view-when-listview-is-empty – Nishant 2013-02-13 13:19:15
感谢您的链接。这是正确的。 – 2013-02-13 13:30:33