ArrayAdapter goes beyond bounds
<p>I have an <code>ArrayAdapter</code> with <code>ArrayList</code> filled. Each time I click on any of its item I re-fill the <code>ArrayList</code> and send <code>notifyOnDataSetChange()</code> to the <code>adapter</code>. But for unknown for me reason it goes out of <code>ArrayList</code> bounds in it's <code>getView()</code> method where it populates its items. I don't understand why this happens. Can you guys explain the theory of <code>getView()</code> invokation so I understand why this going on. Thanks in advance!</p>

<p>Here it is:</p>

<pre><code>class MAdapter extends ArrayAdapter&lt;String&gt; {
    public MAdapter(Context context, int textViewResourceId, List&lt;String&gt; objects) {
        super(context, textViewResourceId, objects);
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View v = convertView;
    if (v == null) {
        LayoutInflater vi = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(R.layout.file_explorer_row, null);
    } else {

    }

        String txt = itemsList.get(position); // Out of bounds happens here
        if (!txt.equals("")) {
            TextView tt = (TextView) v.findViewById(R.id.file_explorer_tv_filename);
            tt.setText(txt);
        }

    return v;
}
</code></pre>

<p><code>itemsList</code> is declared in Outer Class.</p>
