I created a list view and I added a header to it (by using addHeaderview(layout)), then I wrote a click event like:
LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
View itemView = inflater.inflate(R.layout.buypwr, null);
itemView.setOnClickListner(new OnClickListner(){
@Override
public void onClick(View v){
}
But this onClick event didn't fire when I clicked on the header, so can anyone tell me how can I solve my problem?
just try this..
itemView.setOnClickListner(new View.OnClickListner()
{
@Override
public void onClick(View v)
{
}
}
If you have TextView in buypwr.xml then try this
TextView txt = (TextView)itemView.findViewById(......);
txt.setOnClickListner(new View.OnClickListner()
{
@Override
public void onClick(View v)
{
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With