Search code examples
androidandroid-2.2-froyoandroid-2.0-eclair

pull to refresh in android


Possible Duplicate:
How to implement Android Pull-to-Refresh

I have implemented pull to refresh in my app which works fine in 2.2, but in 2.0 it doesn't.

I couldn't find the method 'smoothScrollBy()' in 2.0.

Can anyone please give me the solution for this issue or any other alternative? How can I acheive pull to refresh functionality like in iphone?

Thanks..


Solution

  • smoothScrollBy was introduced in API version 8, so it is not available in other versions. (You can see what API version a method is available in on the far right hand side of the detailed API, like here).

    I'm not sure what refreshing your app has to do with smoothScrollBy though. If you have a ListView with an adapter, you can just update the contents of the adapter and call notifyDataSetChanged()