17

Is there any default function that exists like in iOS to update a listview ? Or any other library ?

user3141985
  • 1,395
  • 4
  • 17
  • 36
  • 2
    possible duplicate of [Pull to refresh like gmail new (4.5) application](http://stackoverflow.com/questions/16975544/pull-to-refresh-like-gmail-new-4-5-application) – elimirks Apr 16 '14 at 18:48
  • 3
    [Thank you, Google!](https://github.com/chrisbanes/ActionBar-PullToRefresh) (time 0,850ms) – Blo Apr 16 '14 at 18:49

2 Answers2

39

This is now supported by the support library and called swipeRefreshLayout

https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html

And here is an example: http://antonioleiva.com/swiperefreshlayout/

Distwo
  • 11,569
  • 8
  • 42
  • 65
5

@elimirks pointed me to correct direction for using ActionBar-PullToRefresh, but for being newbie I was getting a lot or errors and was not able to use it well until I found ActionBar Pull To Refresh Tutorial. To use ActionBar-PullToRefresh the other library SmoothProgressBar is also required and need to be configured.

Thanks.

user3141985
  • 1,395
  • 4
  • 17
  • 36
  • 1
    This solution requires external third party libraries. If you take a look at my answer, it shows you how to use the android component, supported by google, and in my opinion easier and faster to use. Also, it is a new component that had only been added to the library last month or so. – Distwo Apr 17 '14 at 20:24
  • Thanks, I'll try to use the SwipeRefresh in next project. I tried to use it but could not make it work and was also not sure if it will work with older versions of android. – user3141985 Apr 19 '14 at 14:15