开发者

Catching onScroll-Events of a ListView created through an IconicAdapter

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.infla开发者_Python百科te(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!


Try an OnScrollListener

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜