int firstVisible = listView.getFirstVisiblePosition();
int firstVisible = listView.getFirstVisiblePosition(); TextView textView = findViewById(R.id.text_view); textView.setText("First visible item: " + firstVisible);
int firstVisible = listView.getFirstVisiblePosition(); if (firstVisible == 0) { // first visible item is at the top }All of these examples use the android.widget.ListView class from the Android SDK library.