How to traverse the composable tree in android

391 Views Asked by At

I have an activity instance that has its content set via jetpack compose. Now I want to get access to the leaf composables in the composable tree. How can I traverse through the tree given I only have access to the activity instance.

Consider there is just one composable screen living inside the main activity that holds a list of strings

I tried using the decorview to get the root view but the children does not hold any composable inside the root view in this way

0

There are 0 best solutions below