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:
Provided: android.content.Context

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

protected void onStart() {
    FirebaseRecyclerAdapter<Model, ViewHolder> firebaseRecyclerAdapter =
            new FirebaseRecyclerAdapter<Model, ViewHolder>(Model.class, R.layout.row, ViewHolder.class, mRef) {
                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) {

    mView = itemView;


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

    TextView mTitleView = mView.findViewById(;
    TextView mDetailTv = mView.findViewById(;
    ImageView mImageTv = mView.findViewById(;




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 **