就可以实现这一个取巧的办法,针锋相对工作对我来说..
在布局文件,该文件规定了标签内容,把进度条作为:
<?xml version="1.0" encoding="utf-8"?>
<Layout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<ListView
android:id="@+id/updatesList"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>
<ProgressBar
android:id="@+id/progressbar"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
</LinearLayout>
,并在活动的tat显示选项卡的内容,显示在清单或通过进度条(仅一次一个):
if(list != null){
progressBar.setVisibility(View.INVISIBLE);
updatesListView.setVisibility(View.VISIBLE);
adapter = new YourListAdapter(this, list);
updatesListView.setAdapter(adapter);
} else{
progressBar.setVisibility(View.VISIBLE);
updatesListView.setVisibility(View.INVISIBLE);
new Thread(downloadListContent).start();
}
和下载线程完成后,通过一个处理程序或runOnUIThread ,使可视性扭转为
progressBar.setVisibility(View.INVISIBLE);
updatesListView.setVisibility(View.VISIBLE);
此后尝试插入了android标签also..It将帮助用户轻松找到您的问题... – Aravindhan