FileDocCategorySizeDatePackage
ListScrollListener.javaAPI DocAndroid 5.1 API2234Thu Mar 12 22:22:12 GMT 2015android.widget.listview

ListScrollListener

public class ListScrollListener extends android.app.ListActivity implements AbsListView.OnScrollListener
Exercises change notification in a list

Fields Summary
android.os.Handler
mHandler
android.widget.TextView
mText
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);

        setContentView(R.layout.list_scroll_listener);

        String values[] = new String[1000];
        int i=0;
        for(i=0; i<1000; i++) {
            values[i] = ((Integer)i).toString();
        }
        
        mText = (TextView) findViewById(R.id.text);
        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, values));


        getListView().setOnScrollListener(this);
    
public voidonItemSelected(android.widget.AdapterView parent, android.view.View v, int position, long id)

        mText.setText("Position " + position);
    
public voidonNothingSelected(android.widget.AdapterView parent)

        mText.setText("Nothing");
    
public voidonScroll(android.widget.AbsListView view, int firstCell, int cellCount, int itemCount)

        int last = firstCell + cellCount - 1;
        mText.setText("Showing " + firstCell + "-" + last + "/" + itemCount);
    
public voidonScrollStateChanged(android.widget.AbsListView view, int scrollState)