拉动刷新Listview并加载Blackberry

时间:2013-05-08 07:31:56

标签: listview blackberry

我需要在listview中实现pull to refresh和load。我怎样才能使用java在Blackberry中使用pull来刷新和加载listview。

有人能帮助我吗?

1 个答案:

答案 0 :(得分:0)

覆盖ListField管理器的navigationMovement()。然后

Field ff = getLeafFieldWithFocus();
        if( ff instanceof ListField ){
            ListField compo = (ListField)ff;
            int index = compo.getSelectedIndex();
            if( index == compo.getSize() - 1 ){
                // POST YOUR LOGIC HERE !!!
            }
        }

编辑:: 或者

public void drawListRow(ListField lf, Graphics g, int index, int y, int x) {

        if (lf.isFocus() && lf.getSelectedIndex() == index) {
            if(index == (lf.getSize() - 1)){
                //The last row is being focused. Load NEW data here !!!
            }
        }

    }