How check specfied CheckedTextView inside recyclerView while other Unchecked
<p>I am using <code>CheckedTextView</code> in RecyclerView. I have defined only one checkedTextView in xml. And i inflate recylerView with dynamic data from server. Now i want to check only selected CheckedTextView while other unChecked. Only one CheckedTextView should be checked while other should remain unchecked when one is checked.</p>

<p>Here is code that i have written.</p>

<pre><code>public class CategoriesAdapter extends RecyclerView.Adapter&lt;CategoriesAdapter.ViewHolder&gt; {
    CategoriesDTO categoriesDTO;
   String categories[];

    public CategoriesAdapter(CategoriesDTO categoriesDTO){
        this.categoriesDTO=categoriesDTO;
    }
    public CategoriesAdapter(String[] categories){
        this.categories=categories;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.categories_layout, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.category.setText(categories[position]);
    }


    @Override
    public int getItemCount() {
        return categories.length;
    }

    public static class ViewHolder extends RecyclerView.ViewHolder{

        public CheckedTextView category;
        public ViewHolder(View itemView) {
            super(itemView);
            category=(CheckedTextView)itemView.findViewById(R.id.category);
        }
    }
}
</code></pre>

<p>That's how i am setting it checked but it checked all the CheckedTextView.</p>

<pre><code>recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(getContext(), new RecyclerItemClickListener.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                CheckedTextView checkedTextView = (CheckedTextView) view.findViewById(R.id.category);
                checkedTextView.setChecked(true);
                Toast.makeText(getContext(), "" + categories[position], Toast.LENGTH_SHORT).show();
                String url = Constants.URL_BASE_CATEGORY + categories[position];
                new MyAsyncTask().execute(url);
            }
        }));
</code></pre>

<p>how to do it?</p>