ListScrollListenerpublic class ListScrollListener extends android.app.ListActivity implements AbsListView.OnScrollListenerExercises change notification in a list |
Fields Summary |
---|
android.os.Handler | mHandler | android.widget.TextView | mText |
Methods Summary |
---|
public void | onCreate(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 void | onItemSelected(android.widget.AdapterView parent, android.view.View v, int position, long id)
mText.setText("Position " + position);
| public void | onNothingSelected(android.widget.AdapterView parent)
mText.setText("Nothing");
| public void | onScroll(android.widget.AbsListView view, int firstCell, int cellCount, int itemCount)
int last = firstCell + cellCount - 1;
mText.setText("Showing " + firstCell + "-" + last + "/" + itemCount);
| public void | onScrollStateChanged(android.widget.AbsListView view, int scrollState)
|
|