6

First of all, I want to tell you guys I have read and succeed developing Pull to refresh using Chris Banes library and Johan Nilsson library .

Now I'm trying to go with Johan Nilsson library for GridView. He only implemented for ListView so I have to modify PullToRefreshListView JAVA file.

There I have extends GridView instead of ListView (Line 24). Then it will give me a error on Line 109 by saying addHeaderView(mRefreshView); is not recognized and change it as addView() But addView() methods also give me run time errors.

I am going with Johan Nilsson library, because it gives me the opportunity to add some more form widgets to my Activity and easily customize the design rather than the other library.

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
AnujAroshA
  • 4,623
  • 8
  • 56
  • 99
  • 1
    why dont you go for [this example](https://github.com/chrisbanes/Android-PullToRefresh/blob/master/library/src/com/handmark/pulltorefresh/library/PullToRefreshGridView.java)? – MKJParekh May 28 '12 at 10:35
  • @FasteKerinns that's Chris Banes library. Isn't it. I have mentioned it in my Q. That single file depend on another 4 JAVA files and the other issue is, it is difficult to add another form widgets to the Activity. Anyway, thanks for the reply :-) – AnujAroshA May 28 '12 at 10:40
  • did u find the solution I am also facing same problem – Shakeeb Ayaz Mar 10 '14 at 12:58

2 Answers2

2

This is what your looking for

enter image description here

Works for all AbsListView. I've implemented both ListView and GridView.

Daniel Magnusson
  • 9,541
  • 2
  • 38
  • 43
  • 1
    Thanks for the reply. But you haven't read my question clearly. I mentioned that I have used this library and etc... – AnujAroshA Jun 04 '12 at 08:38
0

GridView doesn't support HeaderView. But Google implemented their own GridView, they use it only for internal purposes. This can solve your problem HeaderView