title: Update view inside custom adapter, after pressing the button
body: <p>I need to update progress bar after i press the button inside my custom adapter.
  Only when i declared view value as final i can do that. But it doesn't suit me.
  What are the right solutions to do this ?
  My custom adapter source:</p>
  
  <pre><code>public class DownloadListAdapter extends BaseAdapter implements DownloadManagerListener{
  
      Context ctx;
      LayoutInflater lInflater;
      ArrayList&lt;Product&gt; objects;
      View view;
  
      DownloadListAdapter(Context context, ArrayList&lt;Product&gt; products) {
          ctx = context;
          objects = products;
          lInflater = (LayoutInflater) ctx
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          view = convertView;
          if (view == null) {
              view = lInflater.inflate(R.layout.item, parent, false);
          }
  
          Product p = getProduct(position);
  
          progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
          progressBar.setProgress(p.size);
  
          Button btSet = (Button) view.findViewById(R.id.btSet);
  
          btSet.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  //this does not work
                  progressBar.setProgress(100);
                  //this doesn't work too, it will work only when view will declared as final
                  ProgressBar pb = (ProgressBar) view.findViewById(R.id.progressBar);
                  pb.setProgress(100);
  
              }
          });
  
          return view;
      }
  
      @Override
      public void OnDownloadStarted(long taskId) {
          //This method should also have access to view
      }
  
      @Override
      public int getCount() {
          return objects.size();
      }
  
      @Override
      public Object getItem(int position) {
  
          return objects.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
  
      Product getProduct(int position) {
          return ((Product) getItem(position));
      }
  
  }
  </code></pre>