title: AsyncTask with ViewHolder pattern doesn't work
body: <p>I'm trying to optimize my code into my adapter with AsyncTask to do a internet request to read a JSON and display its data.
  My code before the change with AsyncTask works perfectly so i'm doing something wrong now because it isn't setting the text after the request is expired. I want that while i scroll the listview, AsyncTask run the code of the internet connection and after it's done, it will change the text into textviews from default to right one.</p>
  
  <p><strong>Adapter class</strong></p>
  
  <pre><code>public class ListBookmarksAdapter extends ArrayAdapter&lt;BookmarksHandler&gt;{
      private final Context context;
      private List&lt;BookmarksHandler&gt; list;
      DatabaseHandler dh;
      SQLiteDatabase db;
      ViewHolder viewHolder;
      Gson gson;
  
      public ListBookmarksAdapter(Context context, List&lt;BookmarksHandler&gt; list) {
          super(context, R.layout.listbookmarks, list);
  
          this.context = context;
          this.list = list;
      }
  
      static class ViewHolder{
          TextView tvTitle;
          TextView tvChapter;
          ImageView immagine;
      }
  
      @Override
      public View getView(final int position, View rowView, ViewGroup parent) {
          gson = new Gson();
          dh = new DatabaseHandler(context);
          db = dh.getWritableDatabase();
  
          if(rowView==null){
              LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              rowView = inflater.inflate(R.layout.listbookmarks, parent, false);
  
              viewHolder = new ViewHolder();
  
              viewHolder.tvTitle = (TextView) rowView.findViewById(R.id.tvTitle);
              viewHolder.tvChapter = (TextView) rowView.findViewById(R.id.tvChapter);
              viewHolder.immagine = (ImageView) rowView.findViewById(R.id.imageView);
  
              rowView.setTag(viewHolder);
          } else {
              viewHolder = (ViewHolder) rowView.getTag();
          }
  
          new AsyncList(position).execute("http://www.myurl.com/" +list.get(position).getId_manga() + "/");
  
          return rowView;
      }
  
  
      private class AsyncList extends AsyncTask&lt;String, Void, String&gt; {
          int position;
          public AsyncList(int position){
              this.position = position;
          }
  
          @Override
          protected String doInBackground(String... params) {
              String urlManga = null;
              try {
                  urlManga = MainActivity.connessione(params[0]);
              } catch (Exception e) {
                  e.printStackTrace();
              }
              assert urlManga != null;
              return urlManga.trim();
          }
  
          @Override
          protected void onPostExecute(String result) {
              super.onPostExecute(result);
  
              MangaSpec manga = gson.fromJson(result, MangaSpec.class);
  
              viewHolder.tvTitle.setText(manga.getTitle());
              viewHolder.tvTitle.setSelected(true);
  
              if(Integer.parseInt(String.valueOf(manga.getStatus()))==2)
                  viewHolder.immagine.setImageResource(R.drawable.book_close);
  
              List generic = manga.getChapters();
  
              for(int i=0; i&lt;generic.size(); i++){
                  List chapters = (List) generic.get(i);
                  if(((String) chapters.get(3)).equals(list.get(position).getId_chapter())){
                      double numero = (Double) chapters.get(0);
                      String titoloC = (String) chapters.get(2);
                      if((numero-(int)numero)!=0)
                          viewHolder.tvChapter.setText(numero+" - "+titoloC);
                      else
                          viewHolder.tvChapter.setText((int)numero+" - "+titoloC);
  
                      viewHolder.tvChapter.setSelected(true);
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Here is MainActivity.connessione method:</p>
  
  <pre><code>public static String connessione(String url) throws Exception {
      URL website = new URL(url);
      URLConnection connection = website.openConnection();
      BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
  
      StringBuilder response = new StringBuilder();
      String inputLine;
  
      while ((inputLine = in.readLine()) != null)
          response.append(inputLine);
  
      in.close();
  
      return response.toString();
  }
  </code></pre>
  
  <p>And here is a screen of what i mean:</p>
  
  <p><img src="https://i.stack.imgur.com/SaImE.png" alt="screen"></p>
  
  <p>"Shingeki no Kyoijin" and "63 - Catene" are the items on the first row (follow the arrows). The others two items in the list have different values. As you see, the text is set as default one (Text) for the first two items and it's set wrong for the last one.</p>