Android: Cómo invocar programaticamente evento onScroll en ListView

Estoy intentando invocar programaticamente evento onScroll en ListView.

¿Puede alguien ayudarme?

Aquí mi código:

 @RunWith(RobolectricTestRunner.class) public class ActivityListViewTest { private ActivityListView activity; @Before public void setUp() throws Exception { activity = new ActivityListView(); } @Test public void shouldUpdateListViewChildCountOnCreate() throws Exception{ activity.onCreate(null); ListView calendarListView = (ListView)activity.findViewById(R.id.listview); assertTrue("CHILD COUNT IS: " + calendarListView.getChildCount(), calendarListView.getChildCount() > 0); // Here i want to invoke onScroll event. Then ListView must update and listView items count become to be more that 20 assertTrue("CHILD COUNT IS: " + calendarListView.getChildCount(), calendarListView.getChildCount() > 20); } } 

De la documentación oficial :

 public void smoothScrollByOffset (int offset) 

o

 public void smoothScrollToPosition (int position) 
  • Android equivalente a NSNotificationCenter
  • SensorEventListener en un hilo separado
  • ListView de Android ejecutando un evento en el elemento Liberación de clics largos
  • Android: ¿Por qué un clic largo también activa un clic normal?
  • ¿Cómo deshabilitar el umbral de movimiento al obtener eventos táctiles?
  • Cómo obtener la lista de eventos del calendario del dispositivo en el dispositivo android?
  • ¿Qué significa el valor booleano devuelto por un método de manejo de eventos en Android
  • Evento de la galería a "cuando la imagen se centró"
  • Android: Multi toque y TYPE_SYSTEM_OVERLAY
  • Acceso a LogCat desde Android a través de Python
  • ¿Cómo puede un servicio escuchar los gestos / eventos táctiles?
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.