title: How to update layout child views in recycler view in runtime
body: <p>There is my adapter class</p>
  
  <pre><code>public class AlbumAdapterDemo extends RecyclerView.Adapter&lt;AlbumAdapterDemo.ViewHolder&gt; {
  
  private Context mContext;
  private AlbumModel mAlbumModel;
  private OnItemClickListener mOnItemClickListener;
  private List&lt;ViewHolder&gt; mViewHolders = new ArrayList&lt;&gt;();
  Handler handler;
  File dir;
  
  public AlbumAdapterDemo(Context context, AlbumModel albumModel, OnItemClickListener listener) {
      mContext = context;
      mAlbumModel = albumModel;
      this.mOnItemClickListener = listener;
      dir = new File(context.getExternalFilesDir(null), "audio");
      boolean isDirectoryCreated = dir.exists();
      if (!isDirectoryCreated) {
          isDirectoryCreated = dir.mkdirs();
      }
      if (isDirectoryCreated) {
          // do something
          Log.d("mkdirs option", "Directory already exists.");
      }
  }
  
  public void deleteItem(int position) {
      mAlbumModel.getAudios().remove(position);
      notifyItemRemoved(position);
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(mContext).inflate(R.layout.item_album, parent, false);
      ViewHolder viewHolder = new ViewHolder(view);
      mViewHolders.add(viewHolder);
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
  
      Audio audio = getItem(position);
  
      if (holder.tvAlbumTitle != null) {
          assert audio != null;
          holder.tvAlbumTitle.setText(audio.getTrackName().replace(".mp3", "").replace("_", " "));
      }
      if (holder.audioSize != null) {
          assert audio != null;
          holder.audioSize.setText(audio.getTrackSize());
      }
  
      if (Utils.checkFileExist(dir.getPath() + "/" + mAlbumModel.getAudios().get(position).getTrackName())) {
          if (holder.btnDownload != null) {
              holder.btnDownload.setVisibility(View.INVISIBLE);
          }
          if (holder.btnDelete != null) {
              holder.btnDelete.setVisibility(View.VISIBLE);
          }
      } else {
          if (holder.btnDelete != null) {
              holder.btnDelete.setVisibility(View.INVISIBLE);
          }
          if (holder.btnDownload != null) {
              holder.btnDownload.setVisibility(View.VISIBLE);
          }
      }
  }
  
  @Override
  public int getItemCount() {
      return mAlbumModel.getAudios().size();
  }
  
  private Audio getItem(int position) {
      if (position &gt;= 0 &amp;&amp; position &lt; mAlbumModel.getAudios().size()) {
          return mAlbumModel.getAudios().get(position);
      }
      return null;
  }
  
  public void onEvent(AudioEvent event) {
  
      switch (event.getType()) {
  
          case STOP:
              for (ViewHolder vh : mViewHolders) {
                  if (vh != null) {
                      Audio audio = getItem(vh.getAdapterPosition());
                      if (audio != null &amp;&amp; audio.getTrackId() == (event.getAudio().getTrackId())
                              &amp;&amp; audio.getTrackName().equals(event.getAudio().getTrackName())) {
                          vh.closeSeekBar(true);
                      }
                  }
              }
      }
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
  
      @Nullable
      @Bind(R.id.rl_item_album)
      LinearLayout mLinearLayout;
  
      @Nullable
      @Bind(R.id.tv_item_album)
      TextView tvAlbumTitle;
  
      @Nullable
      @Bind(R.id.btn_delete)
      ImageButton btnDelete;
  
      @Nullable
      @Bind(R.id.btn_download)
      ImageButton btnDownload;
  
      @Nullable
      @Bind(R.id.audioSize)
      TextView audioSize;
  
      @Nullable
      @Bind(R.id.progressBar)
      SeekBar mProgressBar;
  
      public ViewHolder(View itemView) {
          super(itemView);
          try {
              ButterKnife.bind(this, itemView);
          } catch (Exception e) {
              e.printStackTrace();
          }
          handler = new Handler();
      }
  
      @OnClick(R.id.rl_item_album)
      void clickItem() {
          Intent intent = new Intent(mContext, PlayActivity.class);
          intent.putExtra("category", mAlbumModel.getCategory());
          intent.putExtra("url", mAlbumModel.getCategory() + "/" + mAlbumModel.getAlbum() + "/" + mAlbumModel.getAudios().get(getAdapterPosition()).getTrackName());
          mContext.startActivity(intent);
      }
  
      @OnClick({R.id.btn_download, R.id.btn_delete})
      void options(View view) {
          switch (view.getId()) {
              case R.id.btn_delete:
                  if (mOnItemClickListener != null) {
                      mOnItemClickListener.onDeleteListener(mAlbumModel, getAdapterPosition());
                  }
                  break;
              case R.id.btn_download:
                  mOnItemClickListener.onDownloadListener(mAlbumModel, getAdapterPosition());
                  break;
          }
      }
  
  
      public void closeSeekBar(boolean isSeekBar) {
          if (isSeekBar) {
  
              if (btnDownload != null) {
                  btnDownload.setVisibility(View.GONE);
              }
              if (btnDelete != null) {
                  btnDelete.setVisibility(View.VISIBLE);
              }
          }
      }
  }
  
   public interface OnItemClickListener {
      void onDeleteListener(AlbumModel model, int position);
  
      void onDownloadListener(AlbumModel model, int position);
   }
  }
  </code></pre>
  
  <p>I would like to update view when file is downloaded.
  There is my service class</p>
  
  <pre><code>public class DownloadHelper extends Service {
  
  DownloadManager downloadManager;
  File dir;
  private Audio mAudio;
  private HashMap&lt;Long, Audio&gt; specialFeedItem;
  Gson mGson;
  private int counter = 0;
  
  @Nullable
  @Override
  public IBinder onBind(Intent intent) {
      return null;
  }
  
  @Override
  public void onCreate() {
      specialFeedItem = new HashMap&lt;&gt;();
      super.onCreate();
  }
  
  @Override
  public int onStartCommand(final Intent intent, int flags, final int startId) {
  
      if (intent != null) {
          mGson = new Gson();
          String filePath = intent.getStringExtra("file_path");
          String fileName = intent.getStringExtra("file_name");
          String audio = intent.getStringExtra("audio");
          Type type = new TypeToken&lt;Audio&gt;() {
          }.getType();
          mAudio = mGson.fromJson(audio, type);
          dir = new File(getExternalFilesDir(null), "audio");
          if (!dir.exists()) {
              dir.mkdir();
          }
  
          downloadManager = (DownloadManager) this.getSystemService(Context.DOWNLOAD_SERVICE);
          Uri download_uri = Uri.parse(filePath);
          DownloadManager.Request request = new DownloadManager.Request(download_uri);
          request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE);
          request.setAllowedOverRoaming(false);
          request.setDescription(mAudio.getTrackName());
          request.setTitle("test");
          request.setDestinationInExternalFilesDir(this, dir.getName(), fileName);
          final long enqueue = downloadManager.enqueue(request);
  
          specialFeedItem.put(enqueue, mAudio);
          specialFeedItem.get(enqueue).setDownloaded(false);
          new Thread(new Runnable() {
  
              @Override
              public void run() {
  
                  try {
                      boolean downloading = true;
  
                      while (downloading) {
  
                          DownloadManager.Query q = new DownloadManager.Query();
                          q.setFilterById(enqueue);
  
                          Cursor cursor = downloadManager.query(q);
                          if (cursor.moveToFirst()) {
                              if (cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS)) == DownloadManager.STATUS_SUCCESSFUL) {
                                  downloading = false;
                                  if (specialFeedItem.get(enqueue) != null) {
                                      Audio audio1 = specialFeedItem.get(enqueue);
                                      specialFeedItem.get(enqueue).setDownloaded(true);
                                      EventBus.getDefault().post(AudioEvent.stop(audio1));
   //Toast.makeText(DownloadHelper.this, audio1.getTrackName() + " yuklandi.", Toast.LENGTH_SHORT).show();
                                      counter++;
                                  }
  
                              } else {
                                  if (cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS)) == DownloadManager.STATUS_FAILED) {
  //Utils.showToast(DownloadHelper.this, "Yuklashda xatolik bo'ldi?");
                                  }
                              }
                              cursor.close();
                          }
                      }
                  } finally {
                      if (specialFeedItem.size() == counter) {
                          EventBus.getDefault().post(AudioEvent.update());
                          Log.d("Service ", " is done his job ");
                      }
                  }
              }
          }).start();
      }
      return START_STICKY;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So How can I update my view at runtime in recyclerView. Any help is appreciated.</p>