Get rowSpec and columnSpec from Button in GridLayout

531 views Asked by At

I have a gridlayout containing buttons. If I touch one button I want to know which button it was. Therefore I need the span of the rowSpec and columnSpec.

ViewGroup.LayoutParams layoutParams = clickedbutton.getLayoutParams();
String rowSpec = layoutParams.rowSpec.span;

This doesn't work because it doesn't know rowSpec (which should work in my understanding) While debugging I can see that the layoutParams contains the needed value. I just can't find a way to access them.

0

There are 0 answers