How to keep list items in memory?
<p>I have custom listview. When I scroll my listview, android keeps in memory (as far as I understand) items which is displaying on screen and doesn't keep items which is hidden (not scrolled to).</p>

<p>In my case (I think) keeping all list items would be better than generating hidden items.</p>

<p>So, how to "tell" android to keep all items in memory? (15-20 items). PS: if it's wasting of resources, I'd like just to try.</p>

<p>My adapter (some funcs):</p>

<pre><code>private View newView(Context context, ViewGroup parent) {
  LayoutInflater layoutInflater = LayoutInflater.from(context);
  return layoutInflater.inflate(R.layout.myl,parent,false);
}
public View getView(int position,View convertView,ViewGroup parent) {
  View view=null;
  if(convertView!=null) view=convertView; else view=newView(context,parent);
  HashMap&lt;String,String&gt; d=new HashMap&lt;String,String&gt;();
  d=data.get(position); 
  String qweqwe=d.get("qweqwe"); //9 more lines like this.
  TextView txt=(TextView)view.findViewById(R.id.mfmf); //
  txt.setText(qweqwe); //
  txt.setTypeface(mlf); //5 more blocks of 3 lines like this.
  if (smth.equals("0")){
    view.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.mvmv));
  } else {
    view.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.mvmv2));
  }
  return view;
}
</code></pre>
