views:

111

answers:

1

Hi,

I have a ListView stitched together by an IconicAdapter. I want to call a function addNextTenEntries() (which in itself is already working) when the user has scrolled to the bottom of the list, similar to what the Market does (dynamic loading of further entries).

I have tried to implement OnGestureListener to catch the Scroll and Fling-Events, but public boolean onScroll(...){...} is never being triggered.

This is my code (without any of my failing attempts to catch the respective events):

List  title_list = new  ArrayList();

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setListAdapter(new IconicAdapter());
}


class IconicAdapter extends ArrayAdapter {
    IconicAdapter() {
        super(myApp.this, R.layout.row, title_list);
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater=getLayoutInflater();
        View row=inflater.inflate(R.layout.row, parent, false);
        TextView title=(TextView)row.findViewById(R.id.list_title);
        title.setText(title_list.get(position).toString());

        return(row);
    }
}

How can I go about catching scroll events? I have read the documentation regarding ListViews, but I don't know where and how to implement onTouchEvent (if that's even the correct method to do this).

Thanks for your help!

A: 

Try an OnScrollListener

jqpubliq
Thanks, got it :)!
Nick