title: Recycler View item onClick not working.(working abnormally)
body: <p>I have seen all the related links, but didn't found out any solutions yet. I will explain the problem now. I have recyclerview (Grid Layout), i set an on Click listener as i usually do. But this one is behaving abnormally. after so many clicks on different items. OnClick runs for one or two time randomly.Any help will be much appreciated.I will post my Adapter Class code here.</p>
  
  <pre><code>public class CurrentLoadNumberListAdapter extends RecyclerView.Adapter&lt;CurrentLoadNumberListAdapter.ListViewHolder&gt;  {
  
  private Context context;
  private List&lt;CurrentLoadNumberDetail&gt; currentLoadNumberDetailList;
  private NIOClient nioClient;
  private FragmentManager fragmentManager;
  private FragmentActivity myContext;
  private Activity activity;
  private android.support.v4.app.Fragment fragment;
  private SweetAlertDialog sweetAlertDialogProgressBar;
  public static int clickedPosition;
  
  public CurrentLoadNumberListAdapter(Context context, List&lt;CurrentLoadNumberDetail&gt; currentLoadNumberDetailList , Activity activity, NIOClient nioClient) {
      this.context = context;
      this.currentLoadNumberDetailList = currentLoadNumberDetailList;
      this.activity = activity;
      this.nioClient = nioClient;
  }
  
  
  @NonNull
  @Override
  public ListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      LayoutInflater inflater = LayoutInflater.from(context);
      View view = inflater.inflate(R.layout.company_current_load_number_listlayout,null);
      //Specifying Activity for Fragment Transaction
      activity = activity;
      myContext = (FragmentActivity) activity;
      //Iniallizing Fragment Manager
      fragmentManager = myContext.getSupportFragmentManager();
  
      //Making Sweet Alert progress Bar
      sweetAlertDialogProgressBar = new SweetAlertDialog(context,SweetAlertDialog.PROGRESS_TYPE);
      sweetAlertDialogProgressBar.getProgressHelper().setBarColor(Color.parseColor("#9ccc65"));
  
      return new CurrentLoadNumberListAdapter.ListViewHolder(view);
  }
  
  @Override
  public void onBindViewHolder(@NonNull final ListViewHolder holder, final int position) {
      holder.loadNumber.setText(currentLoadNumberDetailList.get(position).getLoadNumber());
  
  }
  
  @Override
  public int getItemCount() {
      return currentLoadNumberDetailList.size();
  }
  
  
  class ListViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
      private Button loadNumber;
  
      public ListViewHolder(View itemView){
          super(itemView);
          loadNumber = itemView.findViewById(R.id.current_load_number);
          itemView.setOnClickListener(this);
  
      }
  
      @Override
      public void onClick(View view) {
          int ItemPosition = getLayoutPosition();
          //nioClient.sendMsg(getMinLoad(currentLoadNumberDetailList.get(position).getIdDeviceLoadRecord())+" \r\n\r\n");
          Toast.makeText(context,"On click " + ItemPosition ,Toast.LENGTH_SHORT).show();
      }
  }
  
  public void updateData(){
          currentLoadNumberDetailList.clear();
          notifyDataSetChanged();
  }
  
  private String getMinLoad(String id){
      Gson gson = new Gson();
      GetMinLoadRequestModel minLoadRequestModel = new GetMinLoadRequestModel();
      minLoadRequestModel.setIdDeviceLoadRecord(id);
      minLoadRequestModel.setMessageType("get_min_load_info");
      String json = gson.toJson(minLoadRequestModel,GetMinLoadRequestModel.class);
      return json;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Anyone please do have a look. Thank you. </p>