I implemented SwipeRefreshLayout in my app. I need to change the height which has to be scrolled down to call onRefresh() method. Which method should I use to add a custom height ?
Implementation of SwipeRefreshLayout
private SwipeRefreshLayout swipeLayout;
In oncreate
swipeLayout = (SwipeRefreshLayout)view.findViewById(R.id.swipe_container);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorScheme(android.R.color.holo_blue_dark,
android.R.color.holo_green_dark,
android.R.color.holo_purple,
android.R.color.holo_orange_dark);
swipeLayout.setSoundEffectsEnabled(true);
Implementing an AsyncTask in onrefresh method
@Override
public void onRefresh()
{
// Asynctask to perform some task
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…