Is there a way to getApplicationContext in my activity ( for a recycler view app)

here is my problem

It’s saying that it needs a firebase context, here is what android studio said;

Required type: com.google.firebase.database.core.Context
Provided: android.content.Context

this is the onstart method, the error is in viewHolder.setDetails(getApplicationContext……

@Override
protected void onStart() {
    super.onStart();
    FirebaseRecyclerAdapter<Model, ViewHolder> firebaseRecyclerAdapter =
            new FirebaseRecyclerAdapter<Model, ViewHolder>(Model.class, R.layout.row, ViewHolder.class, mRef) {
                @Override
                protected void populateViewHolder(ViewHolder viewHolder, Model model, int i) {

                    viewHolder.setDetails(getApplicationContext(), model.getTitle(), model.getDescription(), model.getImage());

                }
            };

NOTE: this activity is not a fragment, it’s a normal activity

public class ViewHolder extends RecyclerView.ViewHolder {

View mView;

public ViewHolder( View itemView) {
    super(itemView);

    mView = itemView;

}

public void setDetails (Context ctx, String title, String description, String image){

    TextView mTitleView = mView.findViewById(R.id.rTitleTV);
    TextView mDetailTv = mView.findViewById(R.id.rDescriptionTV);
    ImageView mImageTv = mView.findViewById(R.id.rImageView);

    mTitleView.setText(title);
    mDetailTv.setText(description);
    Picasso.get().load(image).into(mImageTv);


}
}

Answer

I didn’t have to pass the context because I already had a view. So I replaced getApplicationContext with the viewHolder.

here is the final code;

viewHolder.setDetails(viewHolder, model.getTitle(), model.getDescription(), model.getImage());

**thanks to OhhhThatVarun for his amazing help/pro tip **