How can I stop update listview when is scrolling?
<p>My BaseAdapter works fine but when I scrolling a listview then each item is a double. I don't know how can I stop this.</p>

<p>Below is an array from a PHP server. PHP server sends this as json string.</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [i] =&gt; 122:133:155:201:159:113:153:202:220:222:221:225:109
            [j] =&gt; 8
            [r] =&gt; 9a
        )

    [1] =&gt; Array
        (
            [i] =&gt; 205:182:221
            [j] =&gt; 9
            [r] =&gt; 10
        )

    [2] =&gt; Array
        (
            [i] =&gt; 
            [j] =&gt; 10
            [r] =&gt; 11
        )

    [3] =&gt; Array
        (
            [i] =&gt; 101:102:132
            [j] =&gt; 12
            [r] =&gt; 13
        )

)
</code></pre>

<p>This is Activity:</p>

<pre><code>public class Strefa extends Activity {

    AdapterStrefa mListAdapter;

    ListView listview;
    ArrayList&lt;ListData&gt; myList = new ArrayList&lt;&gt;();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if(GlobalConfig.tryb) {
            setTheme(R.style.AppTheme_Dark);
            setContentView(R.layout.n_strefa);
        } else {
            //setContentView(R.layout.d_statystyki);
        }

        GlobalConfig config = new GlobalConfig();
        JSONArray JsonArray = config.getJsonArray();

        for (int i = 0; i &lt; JsonArray.length(); i++) {

            try {
                JSONObject jsonObject = JsonArray.getJSONObject(i);

                int r = jsonObject.getInt("j");

                ListData ld = new ListData();
                ld.setAdres(jsonObject.getString("i"));
                ld.setStrefa(jsonObject.getString("r") + ":");
                myList.add(ld);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        listview = (ListView) findViewById(R.id.listView);

        mListAdapter = new AdapterStrefa(this, myList);
        listview.setAdapter(mListAdapter);

        /* Powrót */

        Button Back = (Button) findViewById(R.id.back);

        Back.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                finish();

            }
        });

    }

}
</code></pre>

<p>This is my BaseAdaper:</p>

<pre><code>public class AdapterStrefa extends BaseAdapter {

    ArrayList myList = new ArrayList();
    LayoutInflater inflater;
    Context context;


    public AdapterStrefa(Context context, ArrayList myList) {
        this.myList = myList;
        this.context = context;
        inflater = LayoutInflater.from(this.context);
    }

    @Override
    public int getCount() {
        return myList.size();
    }

    @Override
    public ListData getItem(int position) {
        return (ListData) myList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        MyViewHolder mViewHolder;

        if(convertView == null) {

            if(GlobalConfig.tryb) {
                convertView = inflater.inflate(R.layout.n_strefa_item, parent, false);
            } else {
                convertView = inflater.inflate(R.layout.d_zlecenia_lista, parent, false);
            }

            mViewHolder = new MyViewHolder(convertView);
            convertView.setTag(mViewHolder);

        }else {

            mViewHolder = (MyViewHolder) convertView.getTag();

        }


        ListData currentListData = getItem(position);

        mViewHolder.strefa.setText(currentListData.getStrefa());
        mViewHolder.dzielnica.setText(currentListData.getDzielnica());
        //mViewHolder.layout.setText(currentListData.getAdres());


        String CurrentString = currentListData.getAdres();
        String[] separated = CurrentString.split(":");

        for(int i = 0; i &lt; separated.length; i++) {

            if(!separated[i].isEmpty()) {
                Button button = new Button(context, null, android.R.attr.buttonStyleSmall);
                button.setText(context.getString(R.string.string, separated[i]));
                mViewHolder.layout.addView(button);
            }
        }

        return convertView;
    }

    private class MyViewHolder {
        TextView strefa, dzielnica;
        LinearLayout layout;

        public MyViewHolder(View item) {
            strefa = (TextView) item.findViewById(R.id.strefa);
            dzielnica = (TextView) item.findViewById(R.id.dzielnica);
            layout = (LinearLayout) item.findViewById(R.id.layout);
        }
    }
}
</code></pre>

<p>I would like that each items create buttons from a json string. e.g. When first elemnt of array json has a string: 205:182:221, have to create three button in item. When I scroll listview each item is double. How can I stop double?</p>