How to add multiple timer in a list without refreshing the list
<p>I have a list which initially contain one item and a 30 sec timer.After 10 second one more item is attached in the list with one 30 second timer.But When I am trying to do this my first timer value  also get refreshed(i.e it starts again from 30 sec).I want that the whole list should not be refreshed.
Any help will be appreciated.
Thanks in advance.</p>

<pre><code>  public class TestActivity extends ListActivity {
ArrayList&lt;String&gt; pens = new ArrayList&lt;String&gt;();
ArrayAdapter arrayAdapter = null;
MyAdapter madapter;
private static final byte UPDATE_LIST = 100;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(sdei.test.R.layout.main);

    pens.add("MONT Blanc");
    pens.add("Gucci");
    pens.add("Parker");
    getListView().setTextFilterEnabled(true);
    ListView lv = getListView();
    lv.setAdapter( madapter = new MyAdapter(this, pens));

    lv.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                long arg3) {
            // TODO Auto-generated method stub
            System.out.println("..Item is clicked..");
            Message msg = new Message();
            msg.what = UPDATE_LIST;
            updateListHandler.sendMessage(msg);               
        }
    });
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
    // TODO Auto-generated method stub

    super.onConfigurationChanged(newConfig);
    System.out.println("...11configuration is changed...");
}

void addMoreDataToList() {

    pens.add("item1");  
    pens.add("item2");  
    pens.add("item3");  

}       

protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    Object o = this.getListAdapter().getItem(position);
    String pen = o.toString();
    Toast.makeText(this, id + "You have chosen the pen: " + " " + pen,
            Toast.LENGTH_LONG).show();
} 

private Handler updateListHandler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        switch (msg.what) {
        case UPDATE_LIST:
            addMoreDataToList();
            madapter.notifyDataSetChanged();   
            break;     

        }
        ;
    };
};
</code></pre>

<p>}</p>

<p>And the adapter is</p>

<pre><code>public class MyAdapter extends  ArrayAdapter&lt;String&gt; {
long max;
private final Context context;
private final ArrayList values;

public MyAdapter(Context context, ArrayList values) {
    super(context, R.layout.rowlayout, values);
    this.context = context;
    this.values = values;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    Log.i("position is",position+""); 
    LayoutInflater inflater = (LayoutInflater) context 
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
    View rowView = inflater.inflate(R.layout.rowlayout, parent, false);  
    TextView textView = (TextView) rowView.findViewById(R.id.rowtext);
    final TextView tv = (TextView) rowView.findViewById(R.id.timer);  
    CountDownTimer count=new CountDownTimer(15000,1000) {

        @Override
        public void onTick(long millisUntilFinished) {
            // TODO Auto-generated method stub
            max=millisUntilFinished;        
            tv.setText((max/1000)+"");              

        }

        @Override
        public void onFinish() {
            // TODO Auto-generated method stub
            //tv.setText(0+"");
        }
    };
    count.start();
    tv.setText((max/1000)+"");
    textView.setText((CharSequence) values.get(position));
    // Change the icon for Windows and iPhone


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

<p>} </p>
