Q:

How to get access to item's Progress bar inside RecyclerVIew from MainActivity

I have 10 items inside RecyclerView. Each Item has a progressBar.How can i get access  to the ProgressBar from MainActivity. This is my Adapter class.I am handling events using interface when i click on the Button of the Item  in order to change the progress bar.
public class MyHospitalAdapter extends RecyclerView.Adapter<MyHospitalAdapter.MyViewHolder> {
private List<Hospital> mHospitalList;
private Context context;

public onImageClickListener mCallBack;

public interface onImageClickListener {
    void clickOnImage(int id);

    void onTextViewOfPriceSelected(int id, int amountOfProduction, int price, int time, int multiplier);
}

// Provide a reference to the views for each data item
// Complex data items may need more than one view per item, and
// you provide access to all the views for a data item in a view holder
public static class MyViewHolder extends RecyclerView.ViewHolder {
    // each data item is just a string in this case

    ImageView imageView;
    ProgressBar progressBar;
    TextView textViewOnProgressBar;
    Button price;
    TextView productionAmount;
    TextView nameHospital;

    public MyViewHolder(@NonNull View itemView, ImageView imageView, ProgressBar progressBar, TextView textViewOnProgressBar, Button price, TextView productionAmount, TextView nameHospital) {
        super(itemView);
        this.imageView = imageView;
        this.progressBar = progressBar;
        this.textViewOnProgressBar = textViewOnProgressBar;
        this.price = price;
        this.productionAmount = productionAmount;
        this.nameHospital = nameHospital;
    }

}

// Provide a suitable constructor (depends on the kind of dataset)
public MyHospitalAdapter(List<Hospital> mHospitalsList, Context context) {
    this.mHospitalList = mHospitalsList;
    this.context = context;
}

// Create new views (invoked by the layout manager)
@Override
public MyHospitalAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent,
                                                         int viewType) {

    OneBusinesBinding binding =
            DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
                    R.layout.one_busines, parent, false);

    MyViewHolder vh = new MyViewHolder(binding.constraintLayout, binding.imageBusiness, binding.progressBar, binding.textViewOnProgressbar, binding.price, binding.amountofProduction, binding.nameHospital);
    return vh;
}

// Replace the contents of a view (invoked by the layout manager)
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
    // - get element from your dataset at this position
    // - replace the contents of the view with that element
    Hospital currentItem = mHospitalList.get(position);
    int price = currentItem.getPrice();
    int productionAmount = currentItem.getAmount();
    int time = currentItem.getAmount();
    int mMultiplier = currentItem.getMultiplier();

    holder.imageView.setImageResource(AndroidImageAssets.getPictures().get(position));
    holder.productionAmount.setText(context.getString(R.string.amount_of_production, productionAmount));

    holder.price.setText(context.getString(AssetsUpgradeStrings.getStrings_On_Button_Buy().get(position), convertNumberToString(price)));
    holder.progressBar.setProgressTintList(ColorStateList.valueOf(Color.GRAY));
    holder.nameHospital.setText(AssetsUpgradeStrings.getHospitalsNames().get(position));
    holder.textViewOnProgressBar.setText(context.getString(R.string.string_on_progressbar, position));

    holder.imageView.setOnClickListener((v) -> {

        mCallBack.clickOnImage(position);
    });

This is part of MainActivity where i initialize my Adapter.
recyclerView = binding.recyclerView;
    recyclerView.setHasFixedSize(true);

    layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(layoutManager);
    binding.recyclerView.setHasFixedSize(true);
    mAdapter = new MyHospitalAdapter(mListHospitals,getApplicationContext());
    recyclerView.setAdapter(mAdapter);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(mAdapter);

I pass the  List of  the data of  the item.

A:

You can pass you progressbar in interface method:
public interface onImageClickListener {
    void clickOnImage(int id, ProgressBar myProgressBar);

    void onTextViewOfPriceSelected(int id, int amountOfProduction, int price, int time, int multiplier);
}

And use it in callback in activity:
holder.imageView.setOnClickListener((v) -> {
        mCallBack.clickOnImage(position, holder.progressBar);
    });

OR
You can pass your activity instance in constructor of adapter.
...
private MainActivity context;
...
public MyHospitalAdapter(List<Hospital> mHospitalsList, MainActivity context) {
    this.mHospitalList = mHospitalsList;
    this.context = context;
}

Run activity method on button click and pass progress bar as method parameter:
 holder.imageView.setOnClickListener((v) -> {
        context.yourMethodHere(holder.progressBar)
    });

