-1

I want to load old data when I swipe top and load new data when swipe bottom. How do I perform this functionality? Please help me out to perform this operation.

1

1 Answer 1

0

There are tons of libraries available for doing that pull to refresh stuff.

For example have a look here, https://github.com/OrangeGangsters/SwipyRefreshLayout

To achieve your goal simply detect when the user has pulled down the screen and fetch some data back to your screen. See how,

mSwipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh(SwipyRefreshLayoutDirection direction) {
                Log.d("MainActivity", "Refresh triggered at "
                    + (direction == SwipyRefreshLayoutDirection.TOP ? "top" : "bottom"));
            }
}); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.