I am having a Custom List view with Section Header.
Note: this is not ordinary list. It's a Section Header.
Custom List is as follows:
Before clicking the like image it looks like Image 1 and after click it should changed like Image 2.
My problem is that:
It looks very strange if I click on the like image of particular row Like image in others rows get changed.
Some times it throws Null Pointer exception if i click 1st row of the list.
What I need is that if I click on the Like image of particular list it state or color only change, others should keep unchanged.
I tried with this link but it doesn't help me.
Since it is Sectioned header, Adapter calculates the Header also as row so the size of list includes the Header also. Make a notes in this also.
try this. for click listener
holder.like_icon.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
ViewHolder VH = (ViewHolder)convertView.getTag();
VH.like_icon.setBackgroundResource(android.R.drawable.btn_star_big_on);
}
});