Code example for ListActivity

Methods: getListAdapter, setListAdapter

0
    } 
 
    @Test 
    public void shouldSupportSettingAndGettingListAdapter(){ 
        ListAdapter adapter = new CountingAdapter(5);
        listActivity.setListAdapter(adapter);
 
        assertThat(listActivity.getListAdapter()).isNotNull();
    } 
 
    @Test 
    public void shouldSupportOnItemClick() throws Exception { 
        listActivity.setContentView(null);
 
        final boolean[] clicked = new boolean[1];
        ListActivity listActivity = new ListActivity() {
            @Override 
            protected void onListItemClick(ListView l, View v, int position, long id) {
                clicked[0] = true;
            } 
        };