title: RecyclerView duplicating items some time
body: <p>hey guys i m using recyclerview for displaying my images but their same time duplicate the vaule i am searching this problem on google i found <a href="https://stackoverflow.com/questions/36323341/android-preventing-item-duplication-on-recyclerview">this</a> and <a href="https://stackoverflow.com/questions/32771302/recyclerview-items-duplicate-and-constantly-changing">this</a> and <a href="https://stackoverflow.com/questions/36497190/recycler-view-creating-duplicate-items">this</a> or more but no one is helping </p>
  
  <p><strong>my code is</strong></p>
  
  <pre><code>ShareDialog shareDialog;
  String PATH;
  String link , img_txt;
  private ImageLoader imageLoader;
  private Context context;
  String url1;
  CallbackManager callbackManager;
  File file1;
  List&lt;ImgModel&gt; listmodel;
      public ImageAdapter(List&lt;ImgModel&gt; listmodel, Context context) {
      super();
      this.listmodel = listmodel;
      this.context = context;
      setHasStableIds(true);  //added  15/7/2016
  }
     @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v = LayoutInflater.from(parent.getContext())
          .inflate(R.layout.img_row, parent, false);
       ViewHolder viewHolder = new ViewHolder(v);
      return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, final int position) {
  
      ImgModel model = listmodel.get(position);
      imageLoader = CustomVolleyRequest.getInstance(context).getImageLoader();
      imageLoader.get(model.getImageUrl(), ImageLoader.getImageListener(holder.imageView, R.drawable.placeholder, android.R.drawable.ic_dialog_alert));
      holder.imageView.setImageUrl(model.getImageUrl(), imageLoader);
      holder.textViewName.setText(model.getName());
      holder.imageView.setOnLongClickListener(new View.OnLongClickListener() {
      @Override
      public boolean onLongClick(View v) {
          link = listmodel.get(position).getImageUrl();
          img_txt = listmodel.get(position).getName();
          String fileExtension = link.substring(link.lastIndexOf("/"));
          Log.e("0_0","===&gt;"+fileExtension);
          String dir = Environment.getExternalStorageDirectory() + "/Download/myapp/";
           file1 = new File(dir+fileExtension);
          Log.d("file is ","longclick"+file1);
          if (file1.exists()) {
              Intent shareIntent = new Intent();
              shareIntent.setAction(Intent.ACTION_SEND);
              shareIntent.setType("image/jpg");
              shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(String.valueOf(file1))));
              shareIntent.putExtra(Intent.EXTRA_TEXT, img_txt);
              context.startActivity(Intent.createChooser(shareIntent, "Share image with"));
          } else {
              new DownloadFile().execute(link);
          }
          return true;
      }
      });
      holder.imageView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      url1 = listmodel.get(position).getImageUrl();
      Log.e("Hey Amit", "second is url" + url1);
      Imagefull();
      }
      });
      }
  @Override
  public int getItemCount() {
       return listmodel.size();
       }
  
  public long getItemId(int position) {
      return position;
  }
  
   class ViewHolder extends RecyclerView.ViewHolder {
    public NetworkImageView imageView;
    public TextView textViewName;
  
    public ViewHolder(View itemView) {
      super(itemView);
      imageView = (NetworkImageView) itemView.findViewById(R.id.imageView_img);
      textViewName = (TextView) itemView.findViewById(R.id.textview_img);
      callbackManager = CallbackManager.Factory.create();
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/k9E0V.png" rel="nofollow noreferrer">image is here</a></p>