I have an adapter class as below with an interface containing onclick listeners.
public interface OnFeedItemClickListener {
void onCommentsClick(View v, int position);
void onMoreClick(View v, int position);
void onProfileClick(View v);
}
On my activity class when i implement one of the methods it works.
@Override
public void onProfileClick(View v) {
int[] startingLocation = new int[2];
v.getLocationOnScreen(startingLocation);
startingLocation[0] += v.getWidth() / 2;
UserProfileActivity.startUserProfileFromLocation(startingLocation, this);
overridePendingTransition(0, 0);
}
I want help getting an item from the adapter to the activity and displaying it
this is my onViewBinder class
@Override
public void onBindViewHolder(@NonNull FeedAdapter.CellFeedViewHolder viewHolder, final int position) {
viewHolder.bindView(feedItems.get(position));
FeedItem item = feedItems.get(position);
//Making up the feed
viewHolder.name.setText(item.getName());