how to succesfully use lists in android?
<p>I have a little problem with Lists in android. For example I have made an android application. In this application I query the elements of my list but everytime I get the last element when I show it with System.out.println. </p>

<h2>MY MAIN_ACTIVITY:</h2>

<pre><code>package djukic.tests.list;

import java.util.ArrayList;
import java.util.List;
import djukic.tests.list.TagData;
import android.os.Bundle;
import android.app.Activity;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        returnTG();
    }

    public List&lt;TagData&gt; returnTG ()
    {
        List&lt;TagData&gt; list =new ArrayList&lt;TagData&gt;();
        TagData t1 = new TagData();
        TagData test = new TagData();

        for(int i=0; i &lt;= 2 ; i++)
        {   
        t1.setName("Motor" + i);    
        list.add(t1);
        }

        System.out.println("list size = " + list.size());
        test = list.get(0);
        System.out.println("test.getName 2 = " + test.getName());
        test = list.get(1);
        System.out.println("test.getName 2 = " + test.getName());
        test = list.get(2);
        System.out.println("test.getName 2 = " + test.getName());
        return list;

    }
}
</code></pre>

<h2>AND MY TAGDATA.JAVA:</h2>

<pre><code>package djukic.tests.list;


public class TagData 
{
    String name, last, tagID;
    int repetition, sollAmount, lastAmount;

    public TagData()
    {

    }

    public TagData(String name, int repetition, int sollAmount, int lastAmount, String last, String tagID)
    {
        this.name = name;
        this.repetition = repetition;
        this.sollAmount = sollAmount;
        this.lastAmount = lastAmount;
        this.last = last;
        this.tagID = tagID;
    }


    //get Methods
    public String getName()
    {
        return name;
    }

    public int getRepetition()
    {
        return repetition;
    }

    public int getsollAmount()
    {
        return sollAmount;
    }
    public int getlastAmount()
    {
        return lastAmount;
    }

    public String getlastDate()
    {
        return last;
    }

    public String getTagID()
    {
        return tagID;
    }


    //set Methods
    public void setName(String name)
    {
        this.name = name;
    }

    public void setRepetition(int repetition)
    {
        this.repetition = repetition;
    }

    public void setsollAmount(int sollAmount)
    {
        this.sollAmount = sollAmount;
    }
    public void setlastAmount(int letzteAmount)
    {
        this.lastAmount = letzteAmount;
    }

    public void setlastDate(String last)
    {
        this.last = last;
    }

    public void setTagID(String tagID)
    {
        this.tagID = tagID;
    }
}
</code></pre>
