title: Edit Text value becomes null while scrolling listview down or up
body: <p>I am having problem with my listview. while typing text in the edittext, the focus from the edittext(in which i am typing), goes to another edittext in the listview. also when i scroll my listview down the value from the topmost edittext comes down to the last edittext visible in the screen. Help me with this.</p>
  
  <p>My single_row.xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:background="#ffffff" &gt;
  
  &lt;TextView
      android:id="@+id/textViewSingleRowAddEditCategory"
      android:layout_width="250dp"
      android:layout_marginTop="10dp"
      android:layout_height="wrap_content"
      style="@style/font_color_and_type"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:text="TextView" /&gt;
  
  &lt;EditText
      android:id="@+id/editTextSingleRowAddEditCategory"
      android:layout_width="250dp"
      android:layout_height="40dp"
      android:layout_below="@+id/textViewSingleRowAddEditCategory"
      android:layout_centerHorizontal="true" &gt;
  &lt;/EditText&gt;
  
  &lt;ImageView
      android:id="@+id/imageViewAddEditCategoryEraseData"
      android:layout_width="35dp"
      android:layout_height="35dp"
      android:layout_alignTop="@+id/editTextSingleRowAddEditCategory"
      android:layout_toRightOf="@+id/editTextSingleRowAddEditCategory"
      android:src="@drawable/delete4" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>My main_layout.xml code is:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#ffffff"
  tools:context=".AddEditCategory" &gt;
  
  &lt;RelativeLayout
      android:id="@+id/relativeLayoutAddEditCategoryTopBar"
      android:layout_width="match_parent"
      android:layout_height="50dp"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true" &gt;
  
      &lt;TextView
          android:id="@+id/textViewAddEditScreenTitle"
          android:text="Screen Title"
          style="@style/screen_title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageViewAddEditCategoryDelete"
          android:layout_width="22dp"
          android:layout_height="22dp"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:layout_marginRight="24dp"
          android:src="@drawable/set_delete" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;View
      android:id="@+id/view5"
      android:layout_width="match_parent"
      android:layout_height="5dp"
      android:layout_below="@+id/relativeLayoutAddEditCategoryTopBar"
      android:background="@drawable/shadow" /&gt;
  
  &lt;ListView
      android:id="@+id/listViewAddEditCategory"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@+id/view5"
      android:divider="@android:color/transparent"
      android:dividerHeight="1dp" &gt;
  &lt;/ListView&gt;
  
  &lt;Button
      android:id="@+id/buttonAddEditCategorySave"
      android:layout_width="250dp"
      android:layout_height="40dp"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:text="Save" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Main_activity.java's code is given below:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_add_edit_category);
  
      this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  
      Intent intent = getIntent();
      final String operation = intent.getStringExtra("operation");
  
      tv_screen_title = (TextView) findViewById(R.id.textViewAddEditScreenTitle);
      tv_screen_title.setText(operation);
  
      iv_delete = (ImageView) findViewById(R.id.imageViewAddEditCategoryDelete);
  
      al_items_from_editText = new ArrayList&lt;String&gt;();
  
      btn_save = (Button) findViewById(R.id.buttonAddEditCategorySave);
      btn_save.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              if (operation.equals("Add Category")) {
                  loadDatabase();
  
                  View view1 = listview_add_edit_category.getChildAt(0);
                  EditText et = (EditText) view1
                          .findViewById(R.id.editTextSingleRowAddEditCategory);
                  String category_name = et.getText() + "";
                  Log.i("category_name", category_name);
  
                  for (int i = 1; i &lt; listview_add_edit_category
                          .getChildCount(); i++) {
                      View view = listview_add_edit_category.getChildAt(i);
                      EditText editText = (EditText) view
                              .findViewById(R.id.editTextSingleRowAddEditCategory);
                      al_items_from_editText.add(editText.getText()+"");
                      Log.i(i+"", editText.getText()+"");
              }
          }
      });
  
      listview_add_edit_category = (ListView) findViewById(R.id.listViewAddEditCategory);
  
      if (operation.equals("Add Category")) {
          iv_delete.setVisibility(View.GONE);
          manageAddCategoryList();
          mPLAdapter = new PlacesListAdapter(AddEditCategory.this,
                  mPlacesData1, mPlacesData2);
          listview_add_edit_category.setAdapter(mPLAdapter);
      }
  }
  
  private void manageAddCategoryList() {
  
      mPlacesData1.clear();
      mPlacesData2.clear();
  
      mPlacesData1.add("Category Name");
      mPlacesData2.add("Name");
      mPlacesData1.add("# Field 1");
      mPlacesData2.add("Field 1");
      mPlacesData1.add("# Field 2");
      mPlacesData2.add("Field 2");
      mPlacesData1.add("# Field 3");
      mPlacesData2.add("Field 3");
      mPlacesData1.add("# Field 4");
      mPlacesData2.add("Field 4");
      mPlacesData1.add("# Field 5");
      mPlacesData2.add("Field 5");
      mPlacesData1.add("# Field 6");
      mPlacesData2.add("Field 6");
      mPlacesData1.add("# Field 7");
      mPlacesData2.add("Field 7");
      mPlacesData1.add("# Field 8");
      mPlacesData2.add("Field 8");
      mPlacesData1.add("# Field 9");
      mPlacesData2.add("Field 9");
      mPlacesData1.add("# Field 10");
      mPlacesData2.add("Field 10");
  }
  
  private void loadDatabase() {
      database = openOrCreateDatabase(database_name,
              SQLiteDatabase.OPEN_READWRITE, null);
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {
          finish();
          startActivity(new Intent(AddEditCategory.this,
                  CategoryManagement.class));
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  </code></pre>
  
  <p>And this the PlaceListAdapter.java code:</p>
  
  <pre><code>package com.walletapp;
  
  import java.util.ArrayList;
  
  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.ImageView;
  import android.widget.TextView;
  
  public class PlacesListAdapter extends BaseAdapter {
  // private Context mContext;
  private LayoutInflater mInflater;
  private ArrayList&lt;String&gt; al_caption = new ArrayList&lt;String&gt;();
  private ArrayList&lt;String&gt; al_hint = new ArrayList&lt;String&gt;();
  
  public PlacesListAdapter(Context c, ArrayList&lt;String&gt; al_caption,
          ArrayList&lt;String&gt; al_hint) {
      mInflater = LayoutInflater.from(c);
      // mContext = c;
      this.al_caption = al_caption;
      this.al_hint = al_hint;
  }
  
  public int getCount() {
      return al_caption.size();
  }
  
  public Object getItem(int position) {
      return al_caption.get(position);
  }
  
  public long getItemId(int position) {
      return position;
  }
  
  public View getView(final int position, View convertView, ViewGroup parent) {
      final ViewHolder holder;
      if (convertView == null) {
          convertView = mInflater.inflate(
                  R.layout.single_row_add_edit_category, null);
          holder = new ViewHolder();
  
          holder.tv_caption = (TextView) convertView
                  .findViewById(R.id.textViewSingleRowAddEditCategory);
          holder.et_value = (EditText) convertView
                  .findViewById(R.id.editTextSingleRowAddEditCategory);
          holder.erase_data = (ImageView) convertView
                  .findViewById(R.id.imageViewAddEditCategoryEraseData);
  
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      holder.tv_caption.setText(al_caption.get(position));
      holder.et_value.setHint(al_hint.get(position));
      holder.erase_data.setVisibility(View.GONE);
  
      return convertView;
  }
  
  static class ViewHolder {
      TextView tv_caption;
      EditText et_value;
      ImageView erase_data;
  }
  }
  </code></pre>
  
  <p>Please help me anyone.</p>