I have a custom ListView
with my own adapter. I'm handling the click on a Button
in my ListView
's item, and I want the ListView
to become invisible on this click.
I have no idea how to get access to the ListView
from the adapter.
public class ScheduleArrayAdapter extends ArrayAdapter<ScheduleListItem> {
/*...*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final ScheduleListItem o = items.get(position);
if (o != null) {
/*...*/
Button details=(Button)v.findViewById(R.id.btn_details);
details.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//HOW TO MAKE (R.id.lv_schedule) TO BECOME INVISIBLE HERE?
}
});
}
return v;
}
}