当我启动我的活动时,我会用刷新我的列表
swipeContainer.setRefreshing(true);
刷新后调用
swipeContainer.setRefreshing(false);
但在网络通话过程中,refreshIcon在的几分之一秒内出现故障
如果我看安卓显示器,我会得到这些线
D/OpenGLRenderer: endAllStagingAnimators on 0x7f926f5800 (RippleDrawable) with handle 0x7f8dcf50e0
D/OpenGLRenderer: endAllStagingAnimators on 0x7f7ce78000 (ListView) with handle 0x7f89455380
这是什么意思?我怎么才能解决这个问题,这样我就不会收到故障和消息了?
真的很烦人
编辑1这就是我如何称我的setRefreshing(true)
swipeContainer.post(new Runnable() {
@Override
public void run() {
swipeContainer.setRefreshing(true);
}
});
我使用了一个swireRefreshLayout,这可能对你有用:
我的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background2"
android:layout_marginTop="56dp"
android:weightSum="1">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipelayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/lv1"
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:background="#f0f0f0"
android:alpha="0.90"
android:layout_weight="1.01" />
</android.support.v4.widget.SwipeRefreshLayout>
这是我用来刷新活动的代码:
SwipeRefreshLayout mSwipeRefreshLayout;
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipelayout);
mSwipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
finish();
startActivity(getIntent());
}
}
);