One of my AndroidViews are re-inflating on alpha10...
# compose
a
One of my AndroidViews are re-inflating on alpha10 on every recompose. I’m curious what causes a reinflate for an AndroidView. Can anyone help shed light on this? The documentation says it should only run exactly once.
j
Did the same code behave differently on alpha09? If you made code changes, are you using the
key
function anywhere in your app? If you did not make code changes, can you provide a minimal repro so we can investigate further?
🙏 1
a
We skipped alpha09 and I’m coming from alpha08, and it was working well on alpha08. I didn’t find any direct
key()
usage in our app though. I had to make code changes since there were renamed APIs. Since this is happening only on some AndroidViews, I’m guessing making a minimal repro is going to be a challenge. I’m assuming this isn’t suppose to happen. I’ll try reproducing it in a sample project.
For anyone encountering the issue I did a workaround for now by initializing the View outside a
viewBlock
with
remember
, and it seems to work.
Copy code
val view = remember { inflate(...) }
AndroidView(viewBlock = { inflatedView })
j
Can you please file a bug and link it in this thread?