I'm creating a click event, for when pressed a certain LinearLayout
that is in a ListView
. The attributes of this ListView
are in an XML ( item_list
), but it is not being able to fetch the linear to do the event, it is giving NullPointerException
.
...
listView.setAdapter(adapterListView);
beber = (LinearLayout)findViewById(R.id.item_beber);
beber.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
beberCerveja();
}
});
The error occurs on the 2nd row.