1

I need to prevent against lazy load in my custom list-view. so i found that scrollview onscroll listner are helpfull over there i have tryed it but not getting success to implement this functionality.

code::

lviewAdapter = new ListViewAdapter(SaxParser2.this, Arr_ActivityName_fack, Arr_AudioScript_fack,Arr_RequestID_fack,Arr_FolderPath_fack,Arr_RequestTo_fack);
                         lview.setOnScrollListener(SaxParser2.this);
                         lview.setAdapter(lviewAdapter);




@Override
    public void onScroll(AbsListView view, int firstVisibleItem,
            int visibleItemCount, int totalItemCount) {
        // TODO Auto-generated method stub
        if (firstVisibleItem + visibleItemCount == totalItemCount) {
            generateEntries();

            lviewAdapter.notifyDataSetChanged();
        }
    }

    private void generateEntries() {
        for (int x = counter; x < counter + 10; x++) {
            /*
             * Custom temp = new Custom("Big" + x,"Small" + x); fetch.add(temp);
             */
            Arr_ActivityName_fack[x] = Arr_ActivityName[x];
            Arr_AudioScript_fack[x] = Arr_AudioScript[x];
            Arr_RequestID_fack[x] = Arr_RequestID[x];
            Arr_FolderPath_fack[x] = Arr_FolderPath[x];
            Arr_RequestTo_fack[x] = Arr_RequestTo[x];
        }
        counter += 10;
    }

    @Override
    public void onScrollStateChanged(AbsListView arg0, int arg1) {
        // TODO Auto-generated method stub

    }
}

Problem is when i run app,not getting any record.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.