ribot / easy-adapter

[DEPRECATED] Easy Adapters library for Android
http://ribot.github.io
Apache License 2.0
421 stars 50 forks source link

Passing a Context to ViewHolder class #8

Closed devloe closed 10 years ago

devloe commented 10 years ago

I don't know if this is the right place to ask this.

Is there a way to pass a context to the SomethingViewHolder class in order to for instance adding an image dynamically?

Something like this?

public DebateViewHolder(View view, Context c) {
        super(view);
        this.context = c;
    }

Thanks.

devloe commented 10 years ago

Solved it. Sorry.

ivacf commented 10 years ago

The ViewHolder already has a valid Context, you just have to call getContext()