how to set onClick method with linearLayout?
LinearLayout app_layer = (LinearLayout) findViewById (R.id.main_activity_app_layer);
app_layer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(this, "hello", Toast.LENGTH_LONG).show();
}
});
set LinearLayout attribute android:clickable="true"
if you have any button or textview in layout set android:clickable="false"
for all of them
below line is ur code:-
menu_photos.setOnClickListener(new OnClickListener() {
replace this line to below code:-
menu_photos.setOnClickListener(new View.OnClickListener() {