title: The content of EditText contained into a Android ListView isn't saved
body: <p>On my project I have to show to the user a ListView which is contained basically of EditText.</p>
  
  <p>It is like a questionnaire, when he answer to the question he can go down and answer to the next question. (and go back)</p>
  
  <pre><code>public class onAdapter extends BaseAdapter {
      List&lt;PointVerification&gt; mObjects;
      Context mContext;
      LayoutInflater mInflater;
  
      HashMap&lt;Integer, List&lt;ChoixPointVerification&gt;&gt; mChoix;
      HashMap&lt;Integer, ReponsePointVerification&gt; mReponses;
      HashMap&lt;Integer, String&gt; mReponsesActuel;
      Integer mPositionSelectionne;
      Integer mIdIntervention;
  
  
      /**
       * Constructeur
       * @param context
  
       * @param listePointsVerification Liste des points de vérification à afficher.
       * @param listeChoixPointsVerification liste des choix de points de vérification pour chaque point de vérification.
       * @param listeReponsesPointsVerification réponses déjà fournies pour chaque point de vérification
       * @param idIntervention Identifiant de l'intervention
       */
      public onAdapter(
              Context context,
  
              Integer idIntervention, 
              List&lt;PointVerification&gt; listePointsVerification,
              List&lt;ChoixPointVerification&gt;&gt; listeChoixPointsVerification,
              ReponsePointVerification&gt; listeReponsesPointsVerification) {
  
          this.mInflater = LayoutInflater.from(context);
          this.mContext = context;
          this.mObjects = listePointsVerification;
  
          this.mChoix = listeChoixPointsVerification;
          this.mReponses = listeReponsesPointsVerification;
          this.mIdIntervention = idIntervention;
  
  
          // préparation des réponses par position
          this.mReponsesActuel = new HashMap&lt;Integer, String&gt;();
      }
  
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row;
  
          final Integer idPointVerification = getItem(position).id;
  
          if (convertView == null)
          {
              row = mInflater.inflate(R.layout.intervention_reponses_controle_nombre, null);
  
              EditText edValeur = (EditText) row.findViewById(R.id.edValeur);
              // Ajout de l'évènement lorsque l'on change la valeur
              // evènement d'enregistrement
              edValeur.addTextChangedListener(new TextWatcher() 
  
                  @Override
                  public void onTextChanged(CharSequence s, int start, int before, int count) {
                  }
  
                  @Override
                  public void beforeTextChanged(CharSequence s, int start, int count,
                          int after) {
                  }
  
                  @Override
                  public void afterTextChanged(Editable s) {
                      // This hashmap is a try workaround to the bug
                      // i register all modifications into this hashmap
                      mReponsesActuel.put(
                              idPointVerification,
                              s.toString());
  
                      // SAVE PROCEDURE
                      // REMOVED FOR THE EXAMPLE
                      // BUT I UPDATE MY DATABASE
                  }
              });
          }
          else
          {
              row = convertView;
          }
  
          EditText edValeur = (EditText) row.findViewById(R.id.edValeur);
  
          // update of the text
          // it is the contained in the hashmap
          if (mReponsesActuel.containsKey(idPointVerification)) {
              String valeur = mReponsesActuel.get(idPointVerification);
              edValeur.setText(valeur);
          // otherwhise i will look into the database
          } else if (mReponses != null &amp;&amp; mReponses.containsKey(idPointVerification)
                  &amp;&amp; mReponses.get(idPointVerification).valeur != null) {
              edValeur.setText(mReponses.get(idPointVerification).valeur);
          }
          else
          {
              edValeur.setText("");
          }
  
          return row;
      }
  }
  </code></pre>
  
  <p>I don't know why but the user go down in the ListView, the content is unsaved and show some special values like others EditText. I didn't find how to correct that behaviour and it's really in a hurry.</p>
  
  <p>Basically I made a TextWatcher which register data into the database and also into a temporary HashMap which contains all values. That data is called back when GetView is called. If I remove that initialisation, the EditText is erased.</p>
  
  <p>Note : I made some test in my code so there may be different problem.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I uploaded a project with the problem : <a href="http://dl.free.fr/rbqOhUfJF" rel="nofollow">http://dl.free.fr/rbqOhUfJF</a></p>
  
  <p>Here the steps to reproduce the problem :</p>
  
  <ol>
  <li><p>launch the project in debug mode</p></li>
  <li><p>write in the first row A, in the second B, in the third C</p></li>
  <li><p>Scroll down until C is hidden</p></li>
  <li><p>scroll up to the top. Result : There is no more text.</p></li>
  </ol>
  
  <p>If you look closely on the debug log you can see line with afterText. Each times we write some text in the part 2, there will be a debug line with the registration of the event.</p>
  
  <p>But at the phase 3, when you hide an item. the event will be launched with ""</p>
  
  <p>Result : in the 4th phase, it loads the "" string</p>