Just need a clue for the challenge


I could find a solution that someone else has posted but I just need a clue to figure out my own solution
I have implemented an android.view.ViewTreeObserver.OnScrollChangedListener and I am wondering if I am barking up the wrong tree (pun intended)

It seems that I need some sort of listener and that listener should tell me when the user scrolls
anyway here is my solution so far. Notice that the PhotoGalleryFragment class implements onScrollChangedListener

public class PhotoGalleryFragment extends Fragment implements OnScrollChangedListener
private GridView mGridView;
private static Context context;
private ArrayList<GalleryItem> mItems;
public static final String TAG ="PhotoGalleryFragment";
private static PhotoGalleryFragment galleryInstance= new PhotoGalleryFragment();

	private PhotoGalleryFragment()

	public static PhotoGalleryFragment getInstance()
	{return galleryInstance;}
		public void onCreate(Bundle savedInstanceState)
			//Start the flicker fetcher thread running
			new FetchItemsTask().execute();
			//Get the context for all to view
			context= getActivity();
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		View v=inflater.inflate(R.layout.fragment_photo_gallery,container, false);
		return v;
		public void onScrollChanged()
			GridView mGridView=getGridView();
			int lastVisible=32;
			int sizeOfList=64;
				while(lastVisible != sizeOfList)
				lastVisible= mGridView.getLastVisiblePosition();   
				Log.d(TAG,String.format("The last visible position is %d and the bottom of list is %d", lastVisible, sizeOfList));	
Blah blah code code blah blah blah


I have solved this