title: Resource not found exception while trying to add recylerview to a fragment
body: <p>I'm trying to add a <code>recyclerview</code> to a <code>fragment</code>, but somehow there happens to be an error in the <code>adapter</code>.</p>
  
  <p>I think it is the way in which I bind it, and I can't figure out the solution to it. Can anybody help me solve the issue?</p>
  
  <p>here's my adapter:</p>
  
  <pre><code>public class MyLeaguesListAdapter extends 
      RecyclerView.Adapter&lt;MyLeaguesListAdapter.MyViewHolder&gt;{
  
      List&lt;MyContest&gt; listItems;
      Context context;
      public interface OnItemClickListener {
          void onItemClick(View v,int pos);
  
      }
      public MyLeaguesListAdapter(List&lt;MyContest&gt; listItems,Context context){
          this.listItems = listItems;
          this.context = context;
      }
      @NonNull
      @Override
      public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
          View v;
          v = LayoutInflater.from(context).inflate(R.layout.my_contest_item,parent,false);
  
          MyViewHolder myViewHolder = new MyViewHolder(v);
          return myViewHolder;
  
      }
      public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
  
          public TextView leagueName,playerName,prizePool,playerRank,playerPoints,entryFee,spots;
          OnItemClickListener onItemCheckListener;
  
          public MyViewHolder(View itemView) {
              super(itemView);
              leagueName = (TextView) itemView.findViewById(R.id.mc_contest_name);
              playerName = (TextView) itemView.findViewById(R.id.mc_player_name);
              prizePool = (TextView) itemView.findViewById(R.id.mc_prize_pool);
              playerRank = (TextView) itemView.findViewById(R.id.mc_player_rank);
              playerPoints = (TextView) itemView.findViewById(R.id.mc_player_points);
              entryFee = (TextView) itemView.findViewById(R.id.mc_entry_fee);
              spots = (TextView) itemView.findViewById(R.id.mc_spots);
              itemView.setOnClickListener(this);
          }
          public void setItemClickListener(OnItemClickListener ic){
              this.onItemCheckListener = ic;
          }
  
          @Override
          public void onClick(View view) {
              this.onItemCheckListener.onItemClick(view,getAdapterPosition());
          }
      }
      @Override
      public int getItemCount() {
          return listItems.size();
      }
      @Override
      public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
          MyContest listItem = listItems.get(position);
          holder.leagueName.setText(listItem.getLeaguename());
          holder.prizePool.setText(listItem.getPrizepool());
          holder.playerPoints.setText(listItem.getScore());
          holder.playerRank.setText(listItem.getRank());
          holder.playerName.setText(listItem.getUsername());
          holder.spots.setText(listItem.getSpots());
          holder.entryFee.setText(listItem.getFee());
          holder.setItemClickListener(new OnItemClickListener() {
              @Override
              public void onItemClick(View v, int pos) {
  
              }
          });
      }
  }
  </code></pre>
  
  <p>this is my <em>fragment</em>:</p>
  
  <pre><code>public class MyLeagues extends Fragment {
      SharedPreferences sharedPreferences,ui;
      int score,userid,i=0;
      String username,lname,inviteCode;
       List&lt;MyContest&gt; list_item;
       MyLeaguesListAdapter adapter;
      ProgressBar progressBar;
      Sprite fadingCircle;
      RecyclerView recyclerView;
      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_my_leagues,null);
          ui = this.getActivity().getSharedPreferences("User",Context.MODE_PRIVATE);
          userid = ui.getInt("userid",-1);
          progressBar = (ProgressBar) view.findViewById(R.id.mcspin_kit);
          fadingCircle = new FadingCircle();
          progressBar.setIndeterminateDrawable(fadingCircle);
          Log.d("eede", "onCreateView: "+inviteCode);
          recyclerView = (RecyclerView) view.findViewById(R.id.mc_recycler);
          recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
          recyclerView.setItemAnimator(new DefaultItemAnimator());
          recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
          list_item = new ArrayList&lt;&gt;();
          getMYContests();
          return view;
      }
      public void getMYContests(){
          Call&lt;MyContestResponse&gt; call = RetrofitClient
                  .getInstance()
                  .getApi()
                  .getMycontests(userid);
          call.enqueue(new Callback&lt;MyContestResponse&gt;() {
              @Override
              public void onResponse(Call&lt;MyContestResponse&gt; call, Response&lt;MyContestResponse&gt; response) {
                  list_item=response.body().getData();
                  adapter = new MyLeaguesListAdapter(list_item,getContext());
                  progressBar.setVisibility(View.INVISIBLE);
                  recyclerView.setAdapter(adapter);
                  adapter.notifyDataSetChanged();
              }
  
              @Override
              public void onFailure(Call&lt;MyContestResponse&gt; call, Throwable t) {
                  Log.d("bruv", "onFailure: "+t);
              }
          });
      }
  
  }
  </code></pre>
  
  <p>error:</p>
  
  <blockquote>
    <p>07-03 09:36:20.980 30095-30095/? E/AndroidRuntime: FATAL EXCEPTION:
    main
            Process: com.example.android.khelo, PID: 30095
            android.content.res.Resources$NotFoundException: String resource ID #0xffffffff
                at android.content.res.Resources.getText(Resources.java:363)
                at android.widget.TextView.setText(TextView.java:6485)
                at com.example.android.khelo.MyLeaguesListAdapter.onBindViewHolder(MyLeaguesListAdapter.java:75)
                at com.example.android.khelo.MyLeaguesListAdapter.onBindViewHolder(MyLeaguesListAdapter.java:20)</p>
  </blockquote>
  
  <p>from what I've read, the issue is with the way I bind the <code>recylerview</code> but I've not got a clear idea about where the issue actually lies.</p>