@Test public void testGetView() throws Exception { TextView nameView = (TextView) namesAdapter.getView(1, null, new LinearLayout(new Activity())); assertThat(nameView.getText().toString(), equalTo("Heidi Montag")); }
@Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; }
NamesAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; } }
NamesAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; } NamesAdapter(List<String> names); }
NamesAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; } NamesAdapter(List<String> names); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override View getView(int position, View convertView, ViewGroup parent); }
NamesAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { TextView textView = convertView == null ? createView(parent) : (TextView) convertView; textView.setText(names.get(position)); return textView; } NamesAdapter(List<String> names); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override View getView(int position, View convertView, ViewGroup parent);  }