getting data from edittext placed in listview
<p>i created a list with textview &amp; edittext using holder... it look like</p>

<h2>     Textview    Edittext</h2>

<h2>     Textview    Edittext</h2>

<h2>     Textview    Edittext</h2>

<pre><code>                       [button]
</code></pre>

<p>but i cant get the data from each every Edittext &amp; whenever i add a data to any edittext data is swapped to other edittext automatically i can't control over it.My need is to transfer all the edittext data (which are given dynamically) to hash table or something while click a single button... can any one assist me.. hw to achieve it... assist with sample code...</p>

<p>this is my src file.... </p>

<pre><code>package org.me.androidapplication40;

import android.app.Activity;
import android.os.Bundle;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

public class customlistview extends Activity {

 private static class EfficientAdapter extends BaseAdapter {
 private LayoutInflater mInflater;

 public EfficientAdapter(Context context) {
 mInflater = LayoutInflater.from(context);

 }

 public int getCount() {
 return country.length;
 }

 public Object getItem(int position) {
 return position;
 }

 public long getItemId(int position) {
 return position;
 }

 public View getView(int position, View convertView, ViewGroup parent) {
 ViewHolder holder;
 if (convertView == null) {
 convertView = mInflater.inflate(R.layout.listview,parent,false);
 holder = new ViewHolder();
 holder.text = (TextView) convertView.findViewById(R.id.TextView01);
 holder.text2 = (TextView) convertView.findViewById(R.id.TextView02);
 holder.txt=(EditText) convertView.findViewById(R.id.txtbox);

 convertView.setTag(holder);
 } else {
 holder = (ViewHolder) convertView.getTag();
 }

 holder.text.setText(curr[position]);
 holder.text2.setText(country[position]);
holder.txt.setText("");
 return convertView;
 }

 public class ViewHolder {
 TextView text;
 TextView text2;
 EditText txt;
 }
 }

 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 ListView l1 = (ListView) findViewById(R.id.ListView01);
 l1.setAdapter(new EfficientAdapter(this));

 }

 private static final String[] country = { "item1","item2","item3","item4","item5","item6"};
 private static final String[] curr = { "1","2","3","4","5","6"};

}
</code></pre>

<hr>

<p>listview.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_height="wrap_content"
 android:gravity="left|center"
 android:layout_width="wrap_content"
 android:paddingBottom="5px"
 android:paddingTop="5px"
 android:paddingLeft="5px"&gt;
 &lt;TextView android:id="@+id/TextView01"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:gravity="center"
 android:background="@drawable/bg"
 android:textColor="#FFFF00"
 android:text="hi"&gt;&lt;/TextView&gt;
 &lt;TextView android:text="@+id/TextView02"
 android:id="@+id/TextView02"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_marginLeft="10px"
 android:textColor="#0099CC"&gt;&lt;/TextView&gt;
 &lt;EditText
android:id="@+id/txtbox"
android:layout_width="63px"
android:layout_height="30px"
android:textSize="12sp"
android:layout_x="211px"
android:layout_y="13px"
&gt;
&lt;/EditText&gt;
&lt;/LinearLayout&gt;
</code></pre>

<hr>

<p>main.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"&gt;
&lt;TextView android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:text="List of items"
android:textStyle="normal|bold"
android:gravity="center_vertical|center_horizontal"
android:layout_width="fill_parent"&gt;&lt;/TextView&gt;
 &lt;ListView android:id="@+id/ListView01"
 android:layout_height="wrap_content"
 android:layout_width="fill_parent"&gt;
 &lt;/ListView&gt;
&lt;/LinearLayout&gt;
</code></pre>
