@Test public void shouldRecycleViews() throws Exception { TextView textView = (TextView) adapter.getView(1, recycleView, parent); assertThat(textView, sameInstance(recycleView)); assertThat(textView.getText().toString(), equalTo("foo")); }
@Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; }
RecentActivityAdapter extends GenericAdapter<RecentActivity> { @Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; } }
RecentActivityAdapter extends GenericAdapter<RecentActivity> { @Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; } RecentActivityAdapter(List<RecentActivity> recentActivities, LayoutInflater layoutInflater); }
RecentActivityAdapter extends GenericAdapter<RecentActivity> { @Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; } RecentActivityAdapter(List<RecentActivity> recentActivities, LayoutInflater layoutInflater); @Override View getView(RecentActivity item, View recycleView, ViewGroup parent); }
RecentActivityAdapter extends GenericAdapter<RecentActivity> { @Override public View getView(RecentActivity item, View recycleView, ViewGroup parent) { TextView view = (TextView) (recycleView == null ? layoutInflater.inflate(R.layout.activity_summary, parent, false) : recycleView); view.setText(item.getDescription()); return view; } RecentActivityAdapter(List<RecentActivity> recentActivities, LayoutInflater layoutInflater); @Override View getView(RecentActivity item, View recycleView, ViewGroup parent);  }