android.widget.RelativeLayout setOnClickListener is a method that sets an OnClickListener on a RelativeLayout. When the layout is clicked, the OnClickListener's onClick method will be called.
Example:
RelativeLayout myLayout = (RelativeLayout) findViewById(R.id.my_layout); myLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //do something when layout is clicked } });
In this example, we get a reference to a RelativeLayout with an id of "my_layout" and then set an OnClickListener on it. When the layout is clicked, the onClick method will be called, where we can perform any desired actions.
This method is part of the android.widget package library.
Java RelativeLayout.setOnClickListener - 30 examples found. These are the top rated real world Java examples of android.widget.RelativeLayout.setOnClickListener extracted from open source projects. You can rate examples to help us improve the quality of examples.