title: RecyclerView.Adapter notifyDataSetChanged() using ContentProvider
body: <p>Hello I am using ContentProvider and after deleting elements by clicking a button my adapter does not notify, if i go back and come again the element is deleted. So ContentProvider works but notifyDataSetChanged(); doesn't.</p>
  
  <pre><code>public class CategoriesPreferedAdapter extends RecyclerView.Adapter&lt;CategoriesPreferedAdapter.ViewHolder&gt; {
  
  
  private List&lt;ModelCategoriesProvider&gt; feedItemList;
  private Context mContext;
  
  public CategoriesPreferedAdapter(Context context, List&lt;ModelCategoriesProvider&gt; feedItemList) {
      this.feedItemList = feedItemList;
      this.mContext = context;
  }
  
  @Override
  public CategoriesPreferedAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      LayoutInflater inflater = LayoutInflater.from(parent.getContext());
      View itemView = inflater.inflate(R.layout.categories_prefered_adapter, parent, false);
  
      return new CategoriesPreferedAdapter.ViewHolder(itemView);
  
  }
  
  
  @Override
  public void onBindViewHolder(CategoriesPreferedAdapter.ViewHolder holder, final int position) {
      //holder.titleTextView.setText(mList[position]);
      final ModelCategoriesProvider feedItem = feedItemList.get(position);
      holder.setClickListener(new ItemClickListener() {
          @Override
          public void onClick(View view, int position, boolean isLongClick) {
  
              Toast.makeText(view.getContext(),""+feedItem.getId()+"  Users Delete",Toast.LENGTH_LONG).show();
              if (isLongClick) {
              }
  
  
          }
  
      });
  
  
  
      holder.title.setText(feedItem.getName());
  
      Glide.with(mContext)
              .load(Links.ImagePath+feedItem.getImage())
              .centerCrop()
              // .placeholder(R.drawable.ic_porosiicon)
              .crossFade()
              .into(holder.categoryImage);
  
      System.out.println("image path "+feedItem.getImage());
  
      holder.delete_category.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              //deleteId(feedItem.getId()+"");
              String[] whereArgs = {feedItem.getId()+""};
              int count  = mContext.getContentResolver().delete(UsersProvider.CONTENT_URI,UsersProvider.PID+" =?",whereArgs);
              // System.out.println("count erald mjeshtri + mbreti ndaj thuaj princ ndaj thuaj mbret: "+count);
              //EventBus.getDefault().post(new Db_Update("update"));
              notifyDataSetChanged();
  
          }
      });
  
  }
  
  @Override
  public int getItemCount() {
      return (null != feedItemList ? feedItemList.size() : 0);
  }
  
  public static class ViewHolder extends RecyclerView.ViewHolder
          implements View.OnClickListener, View.OnLongClickListener{
      private TextView title,data,type,amount,billnr;
      private ImageView categoryImage,delete_category;
      private ItemClickListener clickListener;
      CardView card_view;
  
  
      public ViewHolder(View itemView) {
          super(itemView);
          card_view = (CardView) itemView.findViewById(R.id.card_view);
  
          title = (TextView) itemView.findViewById(R.id.repoName);
          categoryImage = (ImageView) itemView.findViewById(R.id.imageView_category);
          delete_category = (ImageView) itemView.findViewById(R.id.imageViewfavourites);
          itemView.setTag(itemView);
          itemView.setOnClickListener(this);
          itemView.setOnLongClickListener(this);
  
      }
  
      public void setClickListener(ItemClickListener itemClickListener) {
          this.clickListener = itemClickListener;
      }
  
      @Override
      public void onClick(View view) {
          clickListener.onClick(view, getPosition(), false);
      }
  
      @Override
      public boolean onLongClick(View view) {
          clickListener.onClick(view, getPosition(), true);
          return true;
      }
  }
  </code></pre>
  
  <p>}</p>