有没有人遇到过下拉新鲜动画卡在第三种颜色上的问题?我得到的不是最少3个圆圈(0),而是2.5个,最后一个类似于字母"C"。前两种颜色呈现360度,最后一种颜色停留在180度,停留几秒钟后消失,数据/屏幕刷新。当我注释掉refreshListView()时,循环无限循环。我不确定这是否有关系,但我的圆圈被卡在橙色上,尽管我在代码中没有特别使用这种颜色。
任何想法?
//
刷新代码swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
swipeLayout.setColorSchemeResources(android.R.color.holo_green_light, android.R.color.holo_blue_light, android.R.color.holo_green_light);
swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
swipeLayout.setRefreshing(true);
Log.d("Swipe", "Refreshing Number");
( new Handler()).postDelayed(new Runnable() {
@Override
public void run() {
Connectivity check = new Connectivity(getApplicationContext());
if (!(check.isConnectingToInternet())) {
check.showAlertDialog(Summary.this, "No internet connection", "Noo interweb detected." + " Please check your connection.", false);
}
else {
refreshListView(); //A lot is happening in this method. I don't mind the fact that it takes a little bit to complete, but I do not like that the animation freezes.
}
}
}, 3000);
}
});
我最终崩溃了,并使用Asynctask来解决这个问题。