Hello!
I make a ListView output, everything is fine until the moment ListView becomes long and a scroll appears.
The screen fits 13 lines, I scroll further and the elements begin to repeat: 
After 13 it should go on to 30.
In Adapter, it looks like this:
@Override public View getView(int position, View convertView, ViewGroup parent) { View v; String str = items.get(position); if (convertView == null) { v = LayoutInflater.from(contextAdapter).inflate(R.layout.test_item, parent, false); TextView tvText = (TextView) v.findViewById(R.id.test_item_text); TextView tvText2 = (TextView) v.findViewById(R.id.test_item_text_2); if (tvText != null) tvText.setText("str:" + str); if (tvText2 != null) tvText2.setText("position:" + position); } else { v = convertView; } return v; } If I bring out from if piece with the search for elements in the layout, then everything will be almost fine:
@Override public View getView(int position, View convertView, ViewGroup parent) { View v; String str = items.get(position); if (convertView == null) { v = LayoutInflater.from(contextAdapter).inflate(R.layout.test_item, parent, false); } else { v = convertView; } TextView tvText = (TextView) v.findViewById(R.id.test_item_text); TextView tvText2 = (TextView) v.findViewById(R.id.test_item_text_2); if (tvText != null) tvText.setText("str:" + str); if (tvText2 != null) tvText2.setText("position:" + position); return v; } 
But the problem is that every time I scroll through the list, it rebuilds ALL the elements visible on this screen. How to make it so that he would render the item 1 time, and then take it from the "saved"?
Hashtable<int, View>, before creating, see if there is a hashtable, and after creation, add to the same hashtable. Standard cache, in general. - VladD