SwipeRefresh卡在第3次旋转(蓝色,绿色,橙色)

时间:2015-06-04 03:39:05

标签: android android-animation swiperefreshlayout

有没有人遇到过拉下新鲜动画卡在第三种颜色上的问题?我没有得到至少3个圆圈(O),我得到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);
    }
});

1 个答案:

答案 0 :(得分:0)

我最终崩溃了,并使用Asynctask来解决这个问题。

相关问题