Search code examples
androidxmlandroid-relativelayoutclickable

how to make layout clickable programmatically


I am creating a RelativeLayout programmatically, and thus, I need to add this xml attribute: android:clickable="true" programmatically.

How can this be done? thanks!


Solution

  • you have to use setClickable(true). See the docs