hhl
hhl

Reputation: 97

Find the order of the views in RelativeLayout

I have a RelativeLayout that includes a set of buttons. During app execution the order of buttons is changed.

How to find the order of the buttons in onDestroy()?

Upvotes: 0

Views: 92

Answers (1)

DmitryArc
DmitryArc

Reputation: 4837

for(int i = 0; i < parentLayout.getChildCount(); i++){
    View child = parentLayout.getChildAt(i);
    // other logic here
}

Upvotes: 1

Related Questions